(function (window) {

    var _version = '18.06.11';

    var _Edeye = {
        version: _version,
        printDemo: function () {
            console.log(`
				{
					var func = {};

					func.test = function() {
						console.log('ok');
					}

					_Edeye.load('demo', func);
				}
			`);
        },
        load: function (name, des, param) {
            param['des'] = function () {
                console.log(des);
            }
            this[name] = param;
        }
    };

    {
        var funcName = 'demo';
        var funcDes = 'this is a demo';
        var func = {};
        _Edeye.load(funcName, funcDes, func);
    }

    {
        var funcName = 'checkKit';
        var funcDes = 'this is a check kit';
        var func = {};

        // 综合验证
        func.finalCheck = function (obj, allCheckRetFlag, condition) {

            // var demo = `
            // var ret = Edeye.checkKit.finalCheck(objParam,true,{
            // 'name': {
            // method:'strRange',
            // methodParam:['&&', [ '>=', 2 ], [ '<=', 16 ]],
            // msg:'名称在2~16个字之间'
            // },
            // 'gender': {
            // method:'strRange',
            // methodParam:['&&', [ '>=', 1 ], [ '<=', 1 ]],
            // msg:'请选择性别'
            // },
            // 'age': {
            // method:'integerRange',
            // methodParam:['&&', [ '>=', 18 ], [ '<=', 75 ]],
            // msg:'年龄必须在18~75之间'
            // }
            // });
            // `
            var ret = {
                flag: true,
                msg: []
            }

            for (var tmpKey in condition) {
                if(!condition[tmpKey].methodParam){
                    condition[tmpKey].methodParam = [];
                }
                /**
                 * @author Veigar
                 * 源代码：condition[tmpKey].methodParam.unshift(obj[tmpKey]);
                 * 当obj为 null 或者 undefined 时会报错，修改为如下代码，解决该错误
                 */
                try {
                    condition[tmpKey].methodParam.unshift(obj[tmpKey]);
                } catch (error) {
                    condition[tmpKey].methodParam.unshift('');
                }
                //condition[tmpKey].methodParam.unshift(obj ? obj[tmpKey] ? obj[tmpKey] : '' : '');
                var applyRet = this[condition[tmpKey].method].apply(this, condition[tmpKey].methodParam);
                var typeofRet = typeof(applyRet);
                if('boolean' === typeofRet){
                    if (!applyRet) {
                        if (!allCheckRetFlag) {
                            ret.flag = false;
                            ret.msg = [condition[tmpKey].msg]
                            break;
                        } else {
                            ret.flag = false;
                            ret.msg.push(condition[tmpKey].msg);
                        }
                    }
                }
                if('object' === typeofRet){
                    if (!applyRet.flag) {
                        if (!allCheckRetFlag) {
                            ret.flag = false;
                            ret.msg = applyRet.msg
                            break;
                        } else {
                            ret.flag = false;
                            ret.msg.push(applyRet.msg);
                        }
                    }
                }
            }
            return ret;
        }
        //ip校验-->伯玦
        func.ipCheck = function (ipStr) {
            //TODO-IP验证
            var reg = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/
            return reg.test(ipStr);
        }
        // 字符范围
        func.strRange = function (str, type, condition1, condition2) {
            if (this.isNullOrUndefinedOrNaNOrInfinity(str)) {
                return false;
            }
            var str = String(str);
            if ('&&' !== type && '||' != type || !(condition1 instanceof Array) || !(condition2 instanceof Array) || condition1.length !== 2 || condition2.length !== 2) {
                return false;
            }
            if (condition1[0] !== '<=' && condition1[0] !== '>=' && condition1[0] !== '>' && condition1[0] !== '<' && condition2[0] !== '<=' && condition2[0] !== '>=' && condition2[0] !== '>' && condition2[0] !== '<') {
                return false;
            }
            if (!this.isNumber(condition1[1]) || !this.isNumber(condition2[1])) {
                return false;
            }
            var condition1Flag = eval("str.length " + condition1[0] + " condition1[1]");
            var condition2Flag = eval("str.length " + condition2[0] + " condition2[1]");
            return eval("condition1Flag " + type + " condition2Flag");
        }

        // 整数范围
        func.integerRange = function (number, type, condition1, condition2) {
            var retData = this.numberRange(number, type, condition1, condition2);
            if (retData) {
                var strNumberFlag = this.isStringInteger(number);
                var numberFlag = this.isInteger(number);
                // 调用方法时,如果number为1.0或1,都为1
                if (!strNumberFlag && !numberFlag) {
                    return false;
                }
                return true;
            }
            return false;
        }

        // 小数范围
        func.decimalRange = function (number, type, condition1, condition2) {
            var retData = this.numberRange(number, type, condition1, condition2);
            if (retData) {
                var strNumberFlag = this.isStringDecimal(number);
                var numberFlag = this.isDecimal(number);
                // 调用方法时,如果number为1.0或1,都为1
                if (!strNumberFlag && !numberFlag) {
                    return false;
                }
                return true;
            }
            return false;
        }

        // 数字范围
        // numberRange(123, '&&', [ '>', 122.99 ], [ '<=',123.01 ]);
        func.numberRange = function (number, type, condition1, condition2) {
            var strNumberFlag = this.isStringNumber(number);
            var numberFlag = this.isNumber(number);
            if (!strNumberFlag && !numberFlag) {
                return false;
            }
            if (strNumberFlag) {
                number = Number(number);
            }
            if ('&&' !== type && '||' != type || !(condition1 instanceof Array) || !(condition2 instanceof Array) || condition1.length !== 2 || condition2.length !== 2) {
                return false;
            }
            if (condition1[0] !== '<=' && condition1[0] !== '>=' && condition1[0] !== '>' && condition1[0] !== '<' && condition2[0] !== '<=' && condition2[0] !== '>=' && condition2[0] !== '>' && condition2[0] !== '<') {
                return false;
            }
            if (!this.isNumber(condition1[1]) || !this.isNumber(condition2[1])) {
                return false;
            }
            var condition1Flag = eval("number " + condition1[0] + " condition1[1]");
            var condition2Flag = eval("number " + condition2[0] + " condition2[1]");
            return eval("condition1Flag " + type + " condition2Flag");
        }

        // 判断是否为字符整数
        func.isStringInteger = function (number) {
            if (!this.isStringNumber(number)) {
                return false;
            }
            return number.indexOf(".") <= -1;
        }

        // 判断是否为整数
        func.isInteger = function (number) {
            if (!this.isNumber(number)) {
                return false;
            }
            return String(number).indexOf(".") === -1;
        }

        // 判断是否为字符小数
        func.isStringDecimal = function (number) {
            if (!this.isStringNumber(number)) {
                return false;
            }
            return number.indexOf(".") > -1;
        }

        // 判断是否为小数
        func.isDecimal = function (number) {
            if (!this.isNumber(number)) {
                return false;
            }
            return String(number).indexOf(".") > -1;
        }

        // 判断字符是否为数字
        func.isStringNumber = function (number) {
            if (this.isNullOrUndefinedOrNaNOrInfinity(number)) {
                return false;
            }
            if (number === '0') {
                return true;
            }
            var typeofValue = typeof(number);
            if ('string' === typeofValue) {
                if (/^[0-9]+.?[0-9]*$/.test(number)) {
                    if (number.indexOf('0') === 0 && number.indexOf('0.') === -1) {
                        return false;
                    }
                    return true;
                } else {
                    return false;
                }
                return /^[0-9]+.?[0-9]*$/.test(number);
            } else {
                return false;
            }
        }

        // 判断是否为数字
        func.isNumber = function (number) {
            if (this.isNullOrUndefinedOrNaNOrInfinity(number)) {
                return false;
            }
            return 'number' === typeof(number);
        }

        // 判断参数是否为Null,Undefined,NaN,Infinity
        func.isNullOrUndefinedOrNaNOrInfinity = function (param) {
            if (!param) {
                if (param !== '' && param !== '0' && param !== 0) {
                    return true;
                }
            } else if (param === Infinity) {
                return true;
            }
            return false;
        }

        // 判断是否为url
        func.isUrl = function (url) {
            var strRegex = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\*\+,;=.]+$/;
            var re = new RegExp(strRegex);
            if (re.test(url)) {
                console.log("URL验证结果：验证通过");
                return true;
            } else {
                console.log("URL验证结果：验证不通过");
                return false;
            }
        }

        _Edeye.load(funcName, funcDes, func);
    }

    _Edeye.GetParam = function(argname){
	    var url = decodeURI(document.location.href);
	    var arrStr = url.substring(url.indexOf("?") + 1).split("&");
	    for (var i = 0; i < arrStr.length; i++) {
	      var loc = arrStr[i].indexOf(argname + "=");
	      if (loc != -1) {
	        return arrStr[i].replace(argname + "=", "").replace("?", "");
	        break;
	      }
	    }
	    return "";
	}

    _Edeye.post = function (cfg, func) {
        //	EdeyeAdmin.post({
        //		url:'/aaa/bbb/ccc',
        //		data:{}
        //	},{
        //		SUCCESS:function(ret){
        //		}
        //	});
        var loadingMaskFlag = false;
        var loadingMaskAutoClose = true;
        var loadingMaskTime = 3;
        if ('boolean' === typeof(cfg.loadingMaskFlagParam)) {
            loadingMaskFlag = cfg.loadingMaskFlagParam;
            if ('number' === typeof(cfg.loadingMaskTimeParam)) {
                loadingMaskTime = loadingMaskTimeParam;
            }
        }
        if ('boolean' === typeof(cfg.loadingMaskAutoCloseParam)) {
            loadingMaskAutoClose = cfg.loadingMaskAutoCloseParam;
        }

        if (loadingMaskFlag) {
            EdeyeAdmin.openMsg('处理中,请稍后');
        }

        var postDataObj = cfg.data;
        var formData = new FormData();
        if (postDataObj != undefined) {
            for (var tmpKey in postDataObj) {
                var typeofData = typeof(postDataObj[tmpKey]);
                if (typeofData === 'undefined') {
                    continue;
                }
                if (typeofData === 'string' || typeofData === 'boolean') {
                    formData.append(tmpKey, postDataObj[tmpKey]);
                } else if (typeofData === 'number') {
                    if (isNaN(postDataObj[tmpKey]) || !isFinite(postDataObj[tmpKey])) {
                        continue;
                    } else {
                        formData.append(tmpKey, postDataObj[tmpKey]);
                    }
                } else if (typeofData === 'object') {
                    if (Array.isArray(postDataObj[tmpKey])) {
                        formData.append(tmpKey, JSON.stringify(postDataObj[tmpKey]));
                    } else if (postDataObj[tmpKey] === null) {
                        continue;
                    } else {
                        if (postDataObj[tmpKey].constructor === FileList) {
                            if (postDataObj[tmpKey].length > 0) {
                                for (var tmpInerKey in postDataObj[tmpKey]) {
                                    if (typeof(postDataObj[tmpKey][tmpInerKey]) === 'object') {
                                        formData.append(tmpKey, postDataObj[tmpKey][tmpInerKey]);
                                    }
                                }
                            }
                        } else {
                            formData.append(tmpKey, JSON.stringify(postDataObj[tmpKey]));
                        }
                    }
                }
            }
        }

        // TODO 所有请求增加 加载层
        if(cfg.changqingFlag){
	        var index = layer.load(1, {
	            shade: [0.1,'#fff'] //0.1透明度的白色背景
	        });
        }

        var ajaxCall = $.ajax({
            type: 'POST',
            url: cfg.url,
            data: formData,
            processData: false,
            contentType: false
        });

        ajaxCall.done(function (ret, status, response) {
            if (loadingMaskFlag && loadingMaskAutoClose) {
                EdeyeAdmin.closeChangeMsg(ret.msg,true,1);
            }
            if (func != undefined && 'function' == typeof (func.SUCCESS)) {
                func.SUCCESS(ret);
            } else {
                console.log('done', response);
            }
        });
        ajaxCall.fail(function (response, status) {
            if (response.status === 401) {
                // 登录超时
                // status: 401
                // statusText: "error"
                // responseJSON: {class: "NotLogin",code: "401",datetime: "2018-10-02 11:48:31",msg: "未登录"}
                errorMsg = '登录超时,1秒后重启登录';
                EdeyeAdmin.closeChangeMsg(errorMsg, true, 1);
                setTimeout(function () {
                    EdeyeAdmin.reLoginInner();
                }, 1100)
                return;
            }
            if (loadingMaskFlag) {
                var errorMsg = '';
                if (response.status === 500) {
                    // 后台500错误
                    // status: 500
                    // statusText: "error"
                    // responseJSON: {msg: "/ by zero", datetime: "2018-10-02 11:49:42", code: "500", class: "java.lang.ArithmeticException"}
                    errorMsg = response.responseJSON.msg;
                } else if (response.status === 0) {
                    // 服务器已停止时
                    // status: 0
                    // statusText: "error"
                    errorMsg = '服务器连接失败,请联系管理员';
                } else if (response.status === 403) {
                    // 无权限弹出提示框
                    // ?status: 403
                    // ?statusText: "error"
                    errorMsg = '无此权限';
                }
                EdeyeAdmin.closeChangeMsg(errorMsg, true, 3);
            }

            if (func != undefined && 'function' == typeof (func.ERROR)) {
                func.ERROR(response);
            } else {
                var errorMsg = '';
                if (response.status === 500) {
                    // 后台500错误
                    // status: 500
                    // statusText: "error"
                    // responseJSON: {msg: "/ by zero", datetime: "2018-10-02 11:49:42", code: "500", class: "java.lang.ArithmeticException"}
                    errorMsg = response.responseJSON.msg;
                } else if (response.status === 0) {
                    // 服务器已停止时
                    // status: 0
                    // statusText: "error"
                    errorMsg = '服务器连接失败,请联系管理员';
                } else if (response.status === 403) {
                    // 无权限弹出提示框
                    // ?status: 403
                    // ?statusText: "error"
                    errorMsg = '无此权限';
                }
            	if (loadingMaskFlag) {
                    EdeyeAdmin.closeChangeMsg(errorMsg, true, 3);
            	}else{
                    EdeyeAdmin.closeMsg(errorMsg, true, 3);
            	}
                console.log('fail', response);
            }
        });
        // 请求结束 关闭加载层
        layer.close(index);

    }

    _Edeye.checkbox = function (masterCss, slaveCss, type) {
        if (type === 'BIND') {
            if (masterCss != null) {
                $('.' + masterCss).unbind('click').bind('click', function () {
                    var masterCheckedFlag = $(this).prop("checked");
                    if (masterCheckedFlag) {
                        $('.' + slaveCss).attr("checked", masterCheckedFlag);
                    } else {
                        $('.' + slaveCss).removeAttr("checked");
                    }
                    $('.' + slaveCss).each(function () {
                        $(this)[0].checked = masterCheckedFlag
                    });
                });
            }
            $('.' + slaveCss).unbind('click').bind('click', function () {
                if ($(this).attr("checked") === undefined) {
                    $(this).attr("checked", true);
                } else {
                    $(this).removeAttr("checked");
                }

                var allNum = 0;
                var trueNum = 0;
                var falseNum = 0;
                $('.' + slaveCss).each(function () {
                    allNum++;
                    if ($(this).attr("checked") === undefined) {
                        falseNum++;
                    } else {
                        trueNum++;
                    }
                });
                if (falseNum === 0 && trueNum === allNum) {
                    $('.' + masterCss).attr("checked", true);
                    $('.' + masterCss)[0].checked = true;
                }
                //if (trueNum > 0 && falseNum > 0) {
                if (falseNum > 0) {
                    $('.' + masterCss)[0].checked = false;
                    $('.' + masterCss).removeAttr("checked");
                }
            });
        } else if (type === 'UNBIND') {
            $('.' + masterCss).unbind('click');
            $('.' + slaveCss).unbind('click');
        } else if (type === 'CHECKALL') {
            if ($('.' + masterCss).length > 0) {
                $('.' + masterCss).attr("checked", true);
                $('.' + masterCss)[0].checked = true;
            }
            $('.' + slaveCss).attr("checked", true);
            $('.' + slaveCss).each(function () {
                $(this)[0].checked = true;
            });
        } else if (type === 'CHECKNULL') {
            if ($('.' + masterCss).length > 0) {
                $('.' + masterCss)[0].checked = false;
            }
            $('.' + slaveCss).each(function () {
                $(this)[0].checked = false;
            });
            if ($('.' + masterCss).length > 0) {
                $('.' + masterCss).removeAttr("checked");
            }
            $('.' + slaveCss).removeAttr("checked");
        } else if (type === 'CHECKREVERSE') {
            var allNum = 0;
            var trueNum = 0;
            var falseNum = 0;
            $('.' + slaveCss).each(function () {
                allNum++;
                if ($(this).attr("checked") === 'checked') {
                    falseNum++;
                    $(this)[0].checked = false;
                    $(this).removeAttr("checked");
                } else if ($(this).attr("checked") === undefined) {
                    trueNum++;
                    $(this)[0].checked = true;
                    $(this).attr("checked", true);
                }
            });

            if (trueNum === 0 && falseNum === allNum) {
                // 当前状态为全选
                if ($('.' + masterCss).length > 0) {
                    $('.' + masterCss)[0].checked = false;
                    $('.' + masterCss).removeAttr("checked");
                }
            }
            if (falseNum === 0 && trueNum === allNum) {
                // 当前状态为全不选
                if ($('.' + masterCss).length > 0) {
                    $('.' + masterCss).attr("checked", true);
                    $('.' + masterCss)[0].checked = true;
                }
            }

            // 当前状态为非全选非全不选
        } else if (type === 'GETALL') {
            var ret = [];
            $('.' + slaveCss).each(function () {
                ret.push({
                    'id': $(this).attr("id"),
                    'val': $(this).val()
                });
            });
            return ret;
        } else if (type === 'GETSELECTED') {
            var ret = [];
            $('.' + slaveCss).each(function () {
                if ($(this).attr("checked") === 'checked') {
                    ret.push({
                        'id': $(this).attr("id"),
                        'val': $(this).val()
                    });
                }
            });
            return ret;
        } else if (type === 'GETUNSELECT') {
            var ret = [];
            $('.' + slaveCss).each(function () {
                if ($(this).attr("checked") === undefined) {
                    ret.push({
                        'id': $(this).attr("id"),
                        'val': $(this).val()
                    });
                }
            });
            return ret;
        } else if (type === 'CHECKARRAY') {
            // 'masterClass,slaveClass','val1,val2,...'
            // 'slaveClass','val1,val2,...'
            var pm1Parts = masterCss.split(',');
            var pm2Parts = slaveCss.split(',');
            var a = $("input[class='" + pm1Parts[pm1Parts.length - 1] + "']");
            a.each(function () {
                for (var tmpKey in pm2Parts) {
                    if (pm2Parts[tmpKey] === $(this).val()) {
                        $(this)[0].checked = true;
                        $(this).attr("checked", true);
                    }
                }
            });
            if (pm1Parts.length === 2) {
                var flag = true;
                $('.' + pm1Parts[1]).each(function () {
                    if (!$(this)[0].checked) {
                        flag = false;
                    }
                });
                $('.' + pm1Parts[0])[0].checked = flag;
                if (flag) {
                    $('.' + pm1Parts[0]).attr("checked", true);
                } else {
                    $('.' + pm1Parts[0]).removeAttr("checked");
                }
            }
        }
    }

    _Edeye.openMsg = function (paramContent, showPrefixTime) {
        var content = paramContent;
        if (showPrefixTime === undefined) {
            content = EdeyeAdmin.defaultTime() + ' ' + content;
        } else {
            if (showPrefixTime) {
                content = EdeyeAdmin.defaultTime() + ' ' + content;
            }
        }
        layer.msg('同上', {
            content: content,
            anim: 5,
            scrollbar: false,
            time: -1,
            shade: 0.6
        });
        return true;
    }

    _Edeye.changeMsg = function (paramContent, showPrefixTime) {
        var content = paramContent;
        if (showPrefixTime === undefined) {
            content = EdeyeAdmin.defaultTime() + ' ' + content;
        } else {
            if (showPrefixTime) {
                content = EdeyeAdmin.defaultTime() + ' ' + content;
            }
        }
        $('.layui-layer-content').html(content);
    }

    _Edeye.closeChangeMsg = function (paramContent, showPrefixTime, closeTime) {
        if (paramContent === undefined && showPrefixTime === undefined
            && closeTime === undefined) {
            layer.closeAll();
            return false;
        }
        if (paramContent != undefined && showPrefixTime === undefined
            && closeTime === undefined) {
            this.changeMsg(paramContent, true);
            return new Promise(function (resolve, reject) {
                setTimeout(function () {
                    layer.closeAll();
                    resolve(false);
                }, 3000);
            });
        }
        if (paramContent != undefined && showPrefixTime != undefined
            && closeTime != undefined) {
            this.changeMsg(paramContent, showPrefixTime);
            return new Promise(function (resolve, reject) {
                setTimeout(function () {
                    layer.closeAll();
                    resolve(false);
                }, closeTime * 1000);
            });
        }
    }

    _Edeye.closeMsg = function (paramContent, showPrefixTime, closeTime) {
        if (paramContent === undefined && showPrefixTime === undefined
            && closeTime === undefined) {
            layer.closeAll();
            return false;
        }
        if (paramContent != undefined && showPrefixTime === undefined
            && closeTime === undefined) {
            this.openMsg(paramContent, true);
            return new Promise(function (resolve, reject) {
                setTimeout(function () {
                    layer.closeAll();
                    resolve(false);
                }, 3000);
            });
        }
        if (paramContent != undefined && showPrefixTime != undefined
            && closeTime != undefined) {
            this.openMsg(paramContent, showPrefixTime);
            return new Promise(function (resolve, reject) {
                setTimeout(function () {
                    layer.closeAll();
                    resolve(false);
                }, closeTime * 1000);
            });
        }
    }

    // date function start

    _Edeye.defaultDateTimeFormatDate = function (fDate, formatStr) {
        if (fDate == undefined) {
            return undefined;
        }
        var d = new Date(fDate);

        var Week = ['日', '一', '二', '三', '四', '五', '六'];

        formatStr = formatStr.replace(/yyyy|YYYY/, d.getFullYear());
        formatStr = formatStr.replace(/yy|YY/, (d.getYear() % 100) > 9 ? (d
            .getYear() % 100).toString() : '0' + (d.getYear() % 100));

        formatStr = formatStr.replace(/MM/,
            d.getMonth() > 9 ? (d.getMonth() + 1).toString() : '0'
                + (d.getMonth() + 1));
        formatStr = formatStr.replace(/M/g, d.getMonth());

        formatStr = formatStr.replace(/w|W/g, Week[d.getDay()]);

        formatStr = formatStr.replace(/dd|DD/, d.getDate() > 9 ? d.getDate()
            .toString() : '0' + d.getDate());
        formatStr = formatStr.replace(/d|D/g, d.getDate());

        formatStr = formatStr.replace(/hh|HH/, d.getHours() > 9 ? d.getHours()
            .toString() : '0' + d.getHours());
        formatStr = formatStr.replace(/h|H/g, d.getHours());
        formatStr = formatStr.replace(/mm/, d.getMinutes() > 9 ? d.getMinutes()
            .toString() : '0' + d.getMinutes());
        formatStr = formatStr.replace(/m/g, d.getMinutes());

        formatStr = formatStr.replace(/ss|SS/, d.getSeconds() > 9 ? d
            .getSeconds().toString() : '0' + d.getSeconds());
        formatStr = formatStr.replace(/s|S/g, d.getSeconds());

        return formatStr;
    }

    // ---------------------------------------------------
    // 日期格式化
    // 格式 YYYY/yyyy/YY/yy 表示年份
    // MM/M 月份
    // W/w 星期
    // dd/DD/d/D 日期
    // hh/HH/h/H 时间
    // mm/m 分钟
    // ss/SS/s/S 秒
    // ---------------------------------------------------
    _Edeye.formatDate = function (formatStr) {
        var d = new Date();
        var Week = ['日', '一', '二', '三', '四', '五', '六'];

        formatStr = formatStr.replace(/yyyy|YYYY/, d.getFullYear());
        formatStr = formatStr.replace(/yy|YY/, (d.getYear() % 100) > 9 ? (d
            .getYear() % 100).toString() : '0' + (d.getYear() % 100));

        formatStr = formatStr.replace(/MM/, d.getMonth() > 9 ? d.getMonth()
            .toString() : '0' + d.getMonth());
        formatStr = formatStr.replace(/M/g, d.getMonth());

        formatStr = formatStr.replace(/w|W/g, Week[d.getDay()]);

        formatStr = formatStr.replace(/dd|DD/, d.getDate() > 9 ? d.getDate()
            .toString() : '0' + d.getDate());
        formatStr = formatStr.replace(/d|D/g, d.getDate());

        formatStr = formatStr.replace(/hh|HH/, d.getHours() > 9 ? d.getHours()
            .toString() : '0' + d.getHours());
        formatStr = formatStr.replace(/h|H/g, d.getHours());
        formatStr = formatStr.replace(/mm/, d.getMinutes() > 9 ? d.getMinutes()
            .toString() : '0' + d.getMinutes());
        formatStr = formatStr.replace(/m/g, d.getMinutes());

        formatStr = formatStr.replace(/ss|SS/, d.getSeconds() > 9 ? d
            .getSeconds().toString() : '0' + d.getSeconds());
        formatStr = formatStr.replace(/s|S/g, d.getSeconds());

        return formatStr;
    }

    _Edeye.defaultDateTime = function () {
        return this.formatDate('yyyy-MM-DD hh:mm:ss');
    }
    _Edeye.defaultShortDateTime = function () {
        return this.formatDate('yy-MM-DD hh:mm:ss');
    }
    _Edeye.defaultTime = function () {
        return this.formatDate('hh:mm:ss');
    }

    _Edeye.selectOneIcon = function (CB) {
        if ($('#_6CAE2298F3DC0481C9B752A5969FDF77').length > 0) {
            return;
        }
        var fas = 'fab fa-500px;fab fa-accessible-icon;fab fa-accusoft;fab fa-acquisitions-incorporated;fab fa-adn;fab fa-adversal;fab fa-affiliatetheme;fab fa-algolia;fab fa-alipay;fab fa-amazon;fab fa-amazon-pay;fab fa-amilia;fab fa-android;fab fa-angellist;fab fa-angrycreative;fab fa-angular;fab fa-app-store;fab fa-app-store-ios;fab fa-apper;fab fa-apple;fab fa-apple-pay;fab fa-asymmetrik;fab fa-audible;fab fa-autoprefixer;fab fa-avianex;fab fa-aviato;fab fa-aws;fab fa-bandcamp;fab fa-behance;fab fa-behance-square;fab fa-bimobject;fab fa-bitbucket;fab fa-bitcoin;fab fa-bity;fab fa-black-tie;fab fa-blackberry;fab fa-blogger;fab fa-blogger-b;fab fa-bluetooth;fab fa-bluetooth-b;fab fa-btc;fab fa-buromobelexperte;fab fa-buysellads;fab fa-cc-amazon-pay;fab fa-cc-amex;fab fa-cc-apple-pay;fab fa-cc-diners-club;fab fa-cc-discover;fab fa-cc-jcb;fab fa-cc-mastercard;fab fa-cc-paypal;fab fa-cc-stripe;fab fa-cc-visa;fab fa-centercode;fab fa-chrome;fab fa-cloudscale;fab fa-cloudsmith;fab fa-cloudversify;fab fa-codepen;fab fa-codiepie;fab fa-connectdevelop;fab fa-contao;fab fa-cpanel;fab fa-creative-commons;fab fa-creative-commons-by;fab fa-creative-commons-nc;fab fa-creative-commons-nc-eu;fab fa-creative-commons-nc-jp;fab fa-creative-commons-nd;fab fa-creative-commons-pd;fab fa-creative-commons-pd-alt;fab fa-creative-commons-remix;fab fa-creative-commons-sa;fab fa-creative-commons-sampling;fab fa-creative-commons-sampling-plus;fab fa-creative-commons-share;fab fa-creative-commons-zero;fab fa-critical-role;fab fa-css3;fab fa-css3-alt;fab fa-cuttlefish;fab fa-d-and-d;fab fa-dashcube;fab fa-delicious;fab fa-deploydog;fab fa-deskpro;fab fa-dev;fab fa-deviantart;fab fa-digg;fab fa-digital-ocean;fab fa-discord;fab fa-discourse;fab fa-dochub;fab fa-docker;fab fa-draft2digital;fab fa-dribbble;fab fa-dribbble-square;fab fa-dropbox;fab fa-drupal;fab fa-dyalog;fab fa-earlybirds;fab fa-ebay;fab fa-edge;fab fa-elementor;fab fa-ello;fab fa-ember;fab fa-empire;fab fa-envira;fab fa-erlang;fab fa-ethereum;fab fa-etsy;fab fa-expeditedssl;fab fa-facebook;fab fa-facebook-f;fab fa-facebook-messenger;fab fa-facebook-square;fab fa-fantasy-flight-games;fab fa-firefox;fab fa-first-order;fab fa-first-order-alt;fab fa-firstdraft;fab fa-flickr;fab fa-flipboard;fab fa-fly;fab fa-font-awesome;fab fa-font-awesome-alt;fab fa-font-awesome-flag;fab fa-fonticons;fab fa-fonticons-fi;fab fa-fort-awesome;fab fa-fort-awesome-alt;fab fa-forumbee;fab fa-foursquare;fab fa-free-code-camp;fab fa-freebsd;fab fa-fulcrum;fab fa-galactic-republic;fab fa-galactic-senate;fab fa-get-pocket;fab fa-gg;fab fa-gg-circle;fab fa-git;fab fa-git-square;fab fa-github;fab fa-github-alt;fab fa-github-square;fab fa-gitkraken;fab fa-gitlab;fab fa-gitter;fab fa-glide;fab fa-glide-g;fab fa-gofore;fab fa-goodreads;fab fa-goodreads-g;fab fa-google;fab fa-google-drive;fab fa-google-play;fab fa-google-plus;fab fa-google-plus-g;fab fa-google-plus-square;fab fa-google-wallet;fab fa-gratipay;fab fa-grav;fab fa-gripfire;fab fa-grunt;fab fa-gulp;fab fa-hacker-news;fab fa-hacker-news-square;fab fa-hackerrank;fab fa-hips;fab fa-hire-a-helper;fab fa-hooli;fab fa-hornbill;fab fa-hotjar;fab fa-houzz;fab fa-html5;fab fa-hubspot;fab fa-imdb;fab fa-instagram;fab fa-internet-explorer;fab fa-ioxhost;fab fa-itunes;fab fa-itunes-note;fab fa-java;fab fa-jedi-order;fab fa-jenkins;fab fa-joget;fab fa-joomla;fab fa-js;fab fa-js-square;fab fa-jsfiddle;fab fa-kaggle;fab fa-keybase;fab fa-keycdn;fab fa-kickstarter;fab fa-kickstarter-k;fab fa-korvue;fab fa-laravel;fab fa-lastfm;fab fa-lastfm-square;fab fa-leanpub;fab fa-less;fab fa-line;fab fa-linkedin;fab fa-linkedin-in;fab fa-linode;fab fa-linux;fab fa-lyft;fab fa-magento;fab fa-mailchimp;fab fa-mandalorian;fab fa-markdown;fab fa-mastodon;fab fa-maxcdn;fab fa-medapps;fab fa-medium;fab fa-medium-m;fab fa-medrt;fab fa-meetup;fab fa-megaport;fab fa-microsoft;fab fa-mix;fab fa-mixcloud;fab fa-mizuni;fab fa-modx;fab fa-monero;fab fa-napster;fab fa-neos;fab fa-nimblr;fab fa-nintendo-switch;fab fa-node;fab fa-node-js;fab fa-npm;fab fa-ns8;fab fa-nutritionix;fab fa-odnoklassniki;fab fa-odnoklassniki-square;fab fa-old-republic;fab fa-opencart;fab fa-openid;fab fa-opera;fab fa-optin-monster;fab fa-osi;fab fa-page4;fab fa-pagelines;fab fa-palfed;fab fa-patreon;fab fa-paypal;fab fa-penny-arcade;fab fa-periscope;fab fa-phabricator;fab fa-phoenix-framework;fab fa-phoenix-squadron;fab fa-php;fab fa-pied-piper;fab fa-pied-piper-alt;fab fa-pied-piper-hat;fab fa-pied-piper-pp;fab fa-pinterest;fab fa-pinterest-p;fab fa-pinterest-square;fab fa-playstation;fab fa-product-hunt;fab fa-pushed;fab fa-python;fab fa-qq;fab fa-quinscape;fab fa-quora;fab fa-r-project;fab fa-ravelry;fab fa-react;fab fa-readme;fab fa-rebel;fab fa-red-river;fab fa-reddit;fab fa-reddit-alien;fab fa-reddit-square;fab fa-rendact;fab fa-renren;fab fa-replyd;fab fa-researchgate;fab fa-resolving;fab fa-rev;fab fa-rocketchat;fab fa-rockrms;fab fa-safari;fab fa-sass;fab fa-schlix;fab fa-scribd;fab fa-searchengin;fab fa-sellcast;fab fa-sellsy;fab fa-servicestack;fab fa-shirtsinbulk;fab fa-shopware;fab fa-simplybuilt;fab fa-sistrix;fab fa-sith;fab fa-skyatlas;fab fa-skype;fab fa-slack;fab fa-slack-hash;fab fa-slideshare;fab fa-snapchat;fab fa-snapchat-ghost;fab fa-snapchat-square;fab fa-soundcloud;fab fa-speakap;fab fa-spotify;fab fa-squarespace;fab fa-stack-exchange;fab fa-stack-overflow;fab fa-staylinked;fab fa-steam;fab fa-steam-square;fab fa-steam-symbol;fab fa-sticker-mule;fab fa-strava;fab fa-stripe;fab fa-stripe-s;fab fa-studiovinari;fab fa-stumbleupon;fab fa-stumbleupon-circle;fab fa-superpowers;fab fa-supple;fab fa-teamspeak;fab fa-telegram;fab fa-telegram-plane;fab fa-tencent-weibo;fab fa-the-red-yeti;fab fa-themeco;fab fa-themeisle;fab fa-trade-federation;fab fa-trello;fab fa-tripadvisor;fab fa-tumblr;fab fa-tumblr-square;fab fa-twitch;fab fa-twitter;fab fa-twitter-square;fab fa-typo3;fab fa-uber;fab fa-uikit;fab fa-uniregistry;fab fa-untappd;fab fa-usb;fab fa-ussunnah;fab fa-vaadin;fab fa-viacoin;fab fa-viadeo;fab fa-viadeo-square;fab fa-viber;fab fa-vimeo;fab fa-vimeo-square;fab fa-vimeo-v;fab fa-vine;fab fa-vk;fab fa-vnv;fab fa-vuejs;fab fa-weebly;fab fa-weibo;fab fa-weixin;fab fa-whatsapp;fab fa-whatsapp-square;fab fa-whmcs;fab fa-wikipedia-w;fab fa-windows;fab fa-wix;fab fa-wizards-of-the-coast;fab fa-wolf-pack-battalion;fab fa-wordpress;fab fa-wordpress-simple;fab fa-wpbeginner;fab fa-wpexplorer;fab fa-wpforms;fab fa-xbox;fab fa-xing;fab fa-xing-square;fab fa-y-combinator;fab fa-yahoo;fab fa-yandex;fab fa-yandex-international;fab fa-yelp;fab fa-yoast;fab fa-youtube;fab fa-youtube-square;fab fa-zhihu;far fa-address-book;far fa-address-card;far fa-angry;far fa-arrow-alt-circle-down;far fa-arrow-alt-circle-left;far fa-arrow-alt-circle-right;far fa-arrow-alt-circle-up;far fa-bell;far fa-bell-slash;far fa-bookmark;far fa-building;far fa-calendar;far fa-calendar-alt;far fa-calendar-check;far fa-calendar-minus;far fa-calendar-plus;far fa-calendar-times;far fa-caret-square-down;far fa-caret-square-left;far fa-caret-square-right;far fa-caret-square-up;far fa-chart-bar;far fa-check-circle;far fa-check-square;far fa-circle;far fa-clipboard;far fa-clock;far fa-clone;far fa-closed-captioning;far fa-comment;far fa-comment-alt;far fa-comment-dots;far fa-comments;far fa-compass;far fa-copy;far fa-copyright;far fa-credit-card;far fa-dizzy;far fa-dot-circle;far fa-edit;far fa-envelope;far fa-envelope-open;far fa-eye;far fa-eye-slash;far fa-file;far fa-file-alt;far fa-file-archive;far fa-file-audio;far fa-file-code;far fa-file-excel;far fa-file-image;far fa-file-pdf;far fa-file-powerpoint;far fa-file-video;far fa-file-word;far fa-flag;far fa-flushed;far fa-folder;far fa-folder-open;far fa-frown;far fa-frown-open;far fa-futbol;far fa-gem;far fa-grimace;far fa-grin;far fa-grin-alt;far fa-grin-beam;far fa-grin-beam-sweat;far fa-grin-hearts;far fa-grin-squint;far fa-grin-squint-tears;far fa-grin-stars;far fa-grin-tears;far fa-grin-tongue;far fa-grin-tongue-squint;far fa-grin-tongue-wink;far fa-grin-wink;far fa-hand-lizard;far fa-hand-paper;far fa-hand-peace;far fa-hand-point-down;far fa-hand-point-left;far fa-hand-point-right;far fa-hand-point-up;far fa-hand-pointer;far fa-hand-rock;far fa-hand-scissors;far fa-hand-spock;far fa-handshake;far fa-hdd;far fa-heart;far fa-hospital;far fa-hourglass;far fa-id-badge;far fa-id-card;far fa-image;far fa-images;far fa-keyboard;far fa-kiss;far fa-kiss-beam;far fa-kiss-wink-heart;far fa-laugh;far fa-laugh-beam;far fa-laugh-squint;far fa-laugh-wink;far fa-lemon;far fa-life-ring;far fa-lightbulb;far fa-list-alt;far fa-map;far fa-meh;far fa-meh-blank;far fa-meh-rolling-eyes;far fa-minus-square;far fa-money-bill-alt;far fa-moon;far fa-newspaper;far fa-object-group;far fa-object-ungroup;far fa-paper-plane;far fa-pause-circle;far fa-play-circle;far fa-plus-square;far fa-question-circle;far fa-registered;far fa-sad-cry;far fa-sad-tear;far fa-save;far fa-share-square;far fa-smile;far fa-smile-beam;far fa-smile-wink;far fa-snowflake;far fa-square;far fa-star;far fa-star-half;far fa-sticky-note;far fa-stop-circle;far fa-sun;far fa-surprise;far fa-thumbs-down;far fa-thumbs-up;far fa-times-circle;far fa-tired;far fa-trash-alt;far fa-user;far fa-user-circle;far fa-window-close;far fa-window-maximize;far fa-window-minimize;far fa-window-restore;fas fa-ad;fas fa-address-book;fas fa-address-card;fas fa-adjust;fas fa-air-freshener;fas fa-align-center;fas fa-align-justify;fas fa-align-left;fas fa-align-right;fas fa-allergies;fas fa-ambulance;fas fa-american-sign-language-interpreting;fas fa-anchor;fas fa-angle-double-down;fas fa-angle-double-left;fas fa-angle-double-right;fas fa-angle-double-up;fas fa-angle-down;fas fa-angle-left;fas fa-angle-right;fas fa-angle-up;fas fa-angry;fas fa-ankh;fas fa-apple-alt;fas fa-archive;fas fa-archway;fas fa-arrow-alt-circle-down;fas fa-arrow-alt-circle-left;fas fa-arrow-alt-circle-right;fas fa-arrow-alt-circle-up;fas fa-arrow-circle-down;fas fa-arrow-circle-left;fas fa-arrow-circle-right;fas fa-arrow-circle-up;fas fa-arrow-down;fas fa-arrow-left;fas fa-arrow-right;fas fa-arrow-up;fas fa-arrows-alt;fas fa-arrows-alt-h;fas fa-arrows-alt-v;fas fa-assistive-listening-systems;fas fa-asterisk;fas fa-at;fas fa-atlas;fas fa-atom;fas fa-audio-description;fas fa-award;fas fa-backspace;fas fa-backward;fas fa-balance-scale;fas fa-ban;fas fa-band-aid;fas fa-barcode;fas fa-bars;fas fa-baseball-ball;fas fa-basketball-ball;fas fa-bath;fas fa-battery-empty;fas fa-battery-full;fas fa-battery-half;fas fa-battery-quarter;fas fa-battery-three-quarters;fas fa-bed;fas fa-beer;fas fa-bell;fas fa-bell-slash;fas fa-bezier-curve;fas fa-bible;fas fa-bicycle;fas fa-binoculars;fas fa-birthday-cake;fas fa-blender;fas fa-blender-phone;fas fa-blind;fas fa-bold;fas fa-bolt;fas fa-bomb;fas fa-bone;fas fa-bong;fas fa-book;fas fa-book-dead;fas fa-book-open;fas fa-book-reader;fas fa-bookmark;fas fa-bowling-ball;fas fa-box;fas fa-box-open;fas fa-boxes;fas fa-braille;fas fa-brain;fas fa-briefcase;fas fa-briefcase-medical;fas fa-broadcast-tower;fas fa-broom;fas fa-brush;fas fa-bug;fas fa-building;fas fa-bullhorn;fas fa-bullseye;fas fa-burn;fas fa-bus;fas fa-bus-alt;fas fa-business-time;fas fa-calculator;fas fa-calendar;fas fa-calendar-alt;fas fa-calendar-check;fas fa-calendar-minus;fas fa-calendar-plus;fas fa-calendar-times;fas fa-camera;fas fa-camera-retro;fas fa-campground;fas fa-cannabis;fas fa-capsules;fas fa-car;fas fa-car-alt;fas fa-car-battery;fas fa-car-crash;fas fa-car-side;fas fa-caret-down;fas fa-caret-left;fas fa-caret-right;fas fa-caret-square-down;fas fa-caret-square-left;fas fa-caret-square-right;fas fa-caret-square-up;fas fa-caret-up;fas fa-cart-arrow-down;fas fa-cart-plus;fas fa-cat;fas fa-certificate;fas fa-chair;fas fa-chalkboard;fas fa-chalkboard-teacher;fas fa-charging-station;fas fa-chart-area;fas fa-chart-bar;fas fa-chart-line;fas fa-chart-pie;fas fa-check;fas fa-check-circle;fas fa-check-double;fas fa-check-square;fas fa-chess;fas fa-chess-bishop;fas fa-chess-board;fas fa-chess-king;fas fa-chess-knight;fas fa-chess-pawn;fas fa-chess-queen;fas fa-chess-rook;fas fa-chevron-circle-down;fas fa-chevron-circle-left;fas fa-chevron-circle-right;fas fa-chevron-circle-up;fas fa-chevron-down;fas fa-chevron-left;fas fa-chevron-right;fas fa-chevron-up;fas fa-child;fas fa-church;fas fa-circle;fas fa-circle-notch;fas fa-city;fas fa-clipboard;fas fa-clipboard-check;fas fa-clipboard-list;fas fa-clock;fas fa-clone;fas fa-closed-captioning;fas fa-cloud;fas fa-cloud-download-alt;fas fa-cloud-moon;fas fa-cloud-sun;fas fa-cloud-upload-alt;fas fa-cocktail;fas fa-code;fas fa-code-branch;fas fa-coffee;fas fa-cog;fas fa-cogs;fas fa-coins;fas fa-columns;fas fa-comment;fas fa-comment-alt;fas fa-comment-dollar;fas fa-comment-dots;fas fa-comment-slash;fas fa-comments;fas fa-comments-dollar;fas fa-compact-disc;fas fa-compass;fas fa-compress;fas fa-concierge-bell;fas fa-cookie;fas fa-cookie-bite;fas fa-copy;fas fa-copyright;fas fa-couch;fas fa-credit-card;fas fa-crop;fas fa-crop-alt;fas fa-cross;fas fa-crosshairs;fas fa-crow;fas fa-crown;fas fa-cube;fas fa-cubes;fas fa-cut;fas fa-database;fas fa-deaf;fas fa-desktop;fas fa-dharmachakra;fas fa-diagnoses;fas fa-dice;fas fa-dice-d20;fas fa-dice-d6;fas fa-dice-five;fas fa-dice-four;fas fa-dice-one;fas fa-dice-six;fas fa-dice-three;fas fa-dice-two;fas fa-digital-tachograph;fas fa-directions;fas fa-divide;fas fa-dizzy;fas fa-dna;fas fa-dog;fas fa-dollar-sign;fas fa-dolly;fas fa-dolly-flatbed;fas fa-donate;fas fa-door-closed;fas fa-door-open;fas fa-dot-circle;fas fa-dove;fas fa-download;fas fa-drafting-compass;fas fa-dragon;fas fa-draw-polygon;fas fa-drum;fas fa-drum-steelpan;fas fa-drumstick-bite;fas fa-dumbbell;fas fa-dungeon;fas fa-edit;fas fa-eject;fas fa-ellipsis-h;fas fa-ellipsis-v;fas fa-envelope;fas fa-envelope-open;fas fa-envelope-open-text;fas fa-envelope-square;fas fa-equals;fas fa-eraser;fas fa-euro-sign;fas fa-exchange-alt;fas fa-exclamation;fas fa-exclamation-circle;fas fa-exclamation-triangle;fas fa-expand;fas fa-expand-arrows-alt;fas fa-external-link-alt;fas fa-external-link-square-alt;fas fa-eye;fas fa-eye-dropper;fas fa-eye-slash;fas fa-fast-backward;fas fa-fast-forward;fas fa-fax;fas fa-feather;fas fa-feather-alt;fas fa-female;fas fa-fighter-jet;fas fa-file;fas fa-file-alt;fas fa-file-archive;fas fa-file-audio;fas fa-file-code;fas fa-file-contract;fas fa-file-csv;fas fa-file-download;fas fa-file-excel;fas fa-file-export;fas fa-file-image;fas fa-file-import;fas fa-file-invoice;fas fa-file-invoice-dollar;fas fa-file-medical;fas fa-file-medical-alt;fas fa-file-pdf;fas fa-file-powerpoint;fas fa-file-prescription;fas fa-file-signature;fas fa-file-upload;fas fa-file-video;fas fa-file-word;fas fa-fill;fas fa-fill-drip;fas fa-film;fas fa-filter;fas fa-fingerprint;fas fa-fire;fas fa-fire-extinguisher;fas fa-first-aid;fas fa-fish;fas fa-fist-raised;fas fa-flag;fas fa-flag-checkered;fas fa-flask;fas fa-flushed;fas fa-folder;fas fa-folder-minus;fas fa-folder-open;fas fa-folder-plus;fas fa-font;fas fa-football-ball;fas fa-forward;fas fa-frog;fas fa-frown;fas fa-frown-open;fas fa-funnel-dollar;fas fa-futbol;fas fa-gamepad;fas fa-gas-pump;fas fa-gavel;fas fa-gem;fas fa-genderless;fas fa-ghost;fas fa-gift;fas fa-glass-martini;fas fa-glass-martini-alt;fas fa-glasses;fas fa-globe;fas fa-globe-africa;fas fa-globe-americas;fas fa-globe-asia;fas fa-golf-ball;fas fa-gopuram;fas fa-graduation-cap;fas fa-greater-than;fas fa-greater-than-equal;fas fa-grimace;fas fa-grin;fas fa-grin-alt;fas fa-grin-beam;fas fa-grin-beam-sweat;fas fa-grin-hearts;fas fa-grin-squint;fas fa-grin-squint-tears;fas fa-grin-stars;fas fa-grin-tears;fas fa-grin-tongue;fas fa-grin-tongue-squint;fas fa-grin-tongue-wink;fas fa-grin-wink;fas fa-grip-horizontal;fas fa-grip-vertical;fas fa-h-square;fas fa-hammer;fas fa-hamsa;fas fa-hand-holding;fas fa-hand-holding-heart;fas fa-hand-holding-usd;fas fa-hand-lizard;fas fa-hand-paper;fas fa-hand-peace;fas fa-hand-point-down;fas fa-hand-point-left;fas fa-hand-point-right;fas fa-hand-point-up;fas fa-hand-pointer;fas fa-hand-rock;fas fa-hand-scissors;fas fa-hand-spock;fas fa-hands;fas fa-hands-helping;fas fa-handshake;fas fa-hanukiah;fas fa-hashtag;fas fa-hat-wizard;fas fa-haykal;fas fa-hdd;fas fa-heading;fas fa-headphones;fas fa-headphones-alt;fas fa-headset;fas fa-heart;fas fa-heartbeat;fas fa-helicopter;fas fa-highlighter;fas fa-hiking;fas fa-hippo;fas fa-history;fas fa-hockey-puck;fas fa-home;fas fa-horse;fas fa-hospital;fas fa-hospital-alt;fas fa-hospital-symbol;fas fa-hot-tub;fas fa-hotel;fas fa-hourglass;fas fa-hourglass-end;fas fa-hourglass-half;fas fa-hourglass-start;fas fa-house-damage;fas fa-hryvnia;fas fa-i-cursor;fas fa-id-badge;fas fa-id-card;fas fa-id-card-alt;fas fa-image;fas fa-images;fas fa-inbox;fas fa-indent;fas fa-industry;fas fa-infinity;fas fa-info;fas fa-info-circle;fas fa-italic;fas fa-jedi;fas fa-joint;fas fa-journal-whills;fas fa-kaaba;fas fa-key;fas fa-keyboard;fas fa-khanda;fas fa-kiss;fas fa-kiss-beam;fas fa-kiss-wink-heart;fas fa-kiwi-bird;fas fa-landmark;fas fa-language;fas fa-laptop;fas fa-laptop-code;fas fa-laugh;fas fa-laugh-beam;fas fa-laugh-squint;fas fa-laugh-wink;fas fa-layer-group;fas fa-leaf;fas fa-lemon;fas fa-less-than;fas fa-less-than-equal;fas fa-level-down-alt;fas fa-level-up-alt;fas fa-life-ring;fas fa-lightbulb;fas fa-link;fas fa-lira-sign;fas fa-list;fas fa-list-alt;fas fa-list-ol;fas fa-list-ul;fas fa-location-arrow;fas fa-lock;fas fa-lock-open;fas fa-long-arrow-alt-down;fas fa-long-arrow-alt-left;fas fa-long-arrow-alt-right;fas fa-long-arrow-alt-up;fas fa-low-vision;fas fa-luggage-cart;fas fa-magic;fas fa-magnet;fas fa-mail-bulk;fas fa-male;fas fa-map;fas fa-map-marked;fas fa-map-marked-alt;fas fa-map-marker;fas fa-map-marker-alt;fas fa-map-pin;fas fa-map-signs;fas fa-marker;fas fa-mars;fas fa-mars-double;fas fa-mars-stroke;fas fa-mars-stroke-h;fas fa-mars-stroke-v;fas fa-mask;fas fa-medal;fas fa-medkit;fas fa-meh;fas fa-meh-blank;fas fa-meh-rolling-eyes;fas fa-memory;fas fa-menorah;fas fa-mercury;fas fa-microchip;fas fa-microphone;fas fa-microphone-alt;fas fa-microphone-alt-slash;fas fa-microphone-slash;fas fa-microscope;fas fa-minus;fas fa-minus-circle;fas fa-minus-square;fas fa-mobile;fas fa-mobile-alt;fas fa-money-bill;fas fa-money-bill-alt;fas fa-money-bill-wave;fas fa-money-bill-wave-alt;fas fa-money-check;fas fa-money-check-alt;fas fa-monument;fas fa-moon;fas fa-mortar-pestle;fas fa-mosque;fas fa-motorcycle;fas fa-mountain;fas fa-mouse-pointer;fas fa-music;fas fa-network-wired;fas fa-neuter;fas fa-newspaper;fas fa-not-equal;fas fa-notes-medical;fas fa-object-group;fas fa-object-ungroup;fas fa-oil-can;fas fa-om;fas fa-otter;fas fa-outdent;fas fa-paint-brush;fas fa-paint-roller;fas fa-palette;fas fa-pallet;fas fa-paper-plane;fas fa-paperclip;fas fa-parachute-box;fas fa-paragraph;fas fa-parking;fas fa-passport;fas fa-pastafarianism;fas fa-paste;fas fa-pause;fas fa-pause-circle;fas fa-paw;fas fa-peace;fas fa-pen;fas fa-pen-alt;fas fa-pen-fancy;fas fa-pen-nib;fas fa-pen-square;fas fa-pencil-alt;fas fa-pencil-ruler;fas fa-people-carry;fas fa-percent;fas fa-percentage;fas fa-phone;fas fa-phone-slash;fas fa-phone-square;fas fa-phone-volume;fas fa-piggy-bank;fas fa-pills;fas fa-place-of-worship;fas fa-plane;fas fa-plane-arrival;fas fa-plane-departure;fas fa-play;fas fa-play-circle;fas fa-plug;fas fa-plus;fas fa-plus-circle;fas fa-plus-square;fas fa-podcast;fas fa-poll;fas fa-poll-h;fas fa-poo;fas fa-poop;fas fa-portrait;fas fa-pound-sign;fas fa-power-off;fas fa-pray;fas fa-praying-hands;fas fa-prescription;fas fa-prescription-bottle;fas fa-prescription-bottle-alt;fas fa-print;fas fa-procedures;fas fa-project-diagram;fas fa-puzzle-piece;fas fa-qrcode;fas fa-question;fas fa-question-circle;fas fa-quidditch;fas fa-quote-left;fas fa-quote-right;fas fa-quran;fas fa-random;fas fa-receipt;fas fa-recycle;fas fa-redo;fas fa-redo-alt;fas fa-registered;fas fa-reply;fas fa-reply-all;fas fa-retweet;fas fa-ribbon;fas fa-ring;fas fa-road;fas fa-robot;fas fa-rocket;fas fa-route;fas fa-rss;fas fa-rss-square;fas fa-ruble-sign;fas fa-ruler;fas fa-ruler-combined;fas fa-ruler-horizontal;fas fa-ruler-vertical;fas fa-running;fas fa-rupee-sign;fas fa-sad-cry;fas fa-sad-tear;fas fa-save;fas fa-school;fas fa-screwdriver;fas fa-scroll;fas fa-search;fas fa-search-dollar;fas fa-search-location;fas fa-search-minus;fas fa-search-plus;fas fa-seedling;fas fa-server;fas fa-shapes;fas fa-share;fas fa-share-alt;fas fa-share-alt-square;fas fa-share-square;fas fa-shekel-sign;fas fa-shield-alt;fas fa-ship;fas fa-shipping-fast;fas fa-shoe-prints;fas fa-shopping-bag;fas fa-shopping-basket;fas fa-shopping-cart;fas fa-shower;fas fa-shuttle-van;fas fa-sign;fas fa-sign-in-alt;fas fa-sign-language;fas fa-sign-out-alt;fas fa-signal;fas fa-signature;fas fa-sitemap;fas fa-skull;fas fa-skull-crossbones;fas fa-slash;fas fa-sliders-h;fas fa-smile;fas fa-smile-beam;fas fa-smile-wink;fas fa-smoking;fas fa-smoking-ban;fas fa-snowflake;fas fa-socks;fas fa-solar-panel;fas fa-sort;fas fa-sort-alpha-down;fas fa-sort-alpha-up;fas fa-sort-amount-down;fas fa-sort-amount-up;fas fa-sort-down;fas fa-sort-numeric-down;fas fa-sort-numeric-up;fas fa-sort-up;fas fa-spa;fas fa-space-shuttle;fas fa-spider;fas fa-spinner;fas fa-splotch;fas fa-spray-can;fas fa-square;fas fa-square-full;fas fa-square-root-alt;fas fa-stamp;fas fa-star;fas fa-star-and-crescent;fas fa-star-half;fas fa-star-half-alt;fas fa-star-of-david;fas fa-star-of-life;fas fa-step-backward;fas fa-step-forward;fas fa-stethoscope;fas fa-sticky-note;fas fa-stop;fas fa-stop-circle;fas fa-stopwatch;fas fa-store;fas fa-store-alt;fas fa-stream;fas fa-street-view;fas fa-strikethrough;fas fa-stroopwafel;fas fa-subscript;fas fa-subway;fas fa-suitcase;fas fa-suitcase-rolling;fas fa-sun;fas fa-superscript;fas fa-surprise;fas fa-swatchbook;fas fa-swimmer;fas fa-swimming-pool;fas fa-synagogue;fas fa-sync;fas fa-sync-alt;fas fa-syringe;fas fa-table;fas fa-table-tennis;fas fa-tablet;fas fa-tablet-alt;fas fa-tablets;fas fa-tachometer-alt;fas fa-tag;fas fa-tags;fas fa-tape;fas fa-tasks;fas fa-taxi;fas fa-teeth;fas fa-teeth-open;fas fa-terminal;fas fa-text-height;fas fa-text-width;fas fa-th;fas fa-th-large;fas fa-th-list;fas fa-theater-masks;fas fa-thermometer;fas fa-thermometer-empty;fas fa-thermometer-full;fas fa-thermometer-half;fas fa-thermometer-quarter;fas fa-thermometer-three-quarters;fas fa-thumbs-down;fas fa-thumbs-up;fas fa-thumbtack;fas fa-ticket-alt;fas fa-times;fas fa-times-circle;fas fa-tint;fas fa-tint-slash;fas fa-tired;fas fa-toggle-off;fas fa-toggle-on;fas fa-toilet-paper;fas fa-toolbox;fas fa-tooth;fas fa-torah;fas fa-torii-gate;fas fa-tractor;fas fa-trademark;fas fa-traffic-light;fas fa-train;fas fa-transgender;fas fa-transgender-alt;fas fa-trash;fas fa-trash-alt;fas fa-tree;fas fa-trophy;fas fa-truck;fas fa-truck-loading;fas fa-truck-monster;fas fa-truck-moving;fas fa-truck-pickup;fas fa-tshirt;fas fa-tty;fas fa-tv;fas fa-umbrella;fas fa-umbrella-beach;fas fa-underline;fas fa-undo;fas fa-undo-alt;fas fa-universal-access;fas fa-university;fas fa-unlink;fas fa-unlock;fas fa-unlock-alt;fas fa-upload;fas fa-user;fas fa-user-alt;fas fa-user-alt-slash;fas fa-user-astronaut;fas fa-user-check;fas fa-user-circle;fas fa-user-clock;fas fa-user-cog;fas fa-user-edit;fas fa-user-friends;fas fa-user-graduate;fas fa-user-injured;fas fa-user-lock;fas fa-user-md;fas fa-user-minus;fas fa-user-ninja;fas fa-user-plus;fas fa-user-secret;fas fa-user-shield;fas fa-user-slash;fas fa-user-tag;fas fa-user-tie;fas fa-user-times;fas fa-users;fas fa-users-cog;fas fa-utensil-spoon;fas fa-utensils;fas fa-vector-square;fas fa-venus;fas fa-venus-double;fas fa-venus-mars;fas fa-vial;fas fa-vials;fas fa-video;fas fa-video-slash;fas fa-vihara;fas fa-volleyball-ball;fas fa-volume-down;fas fa-volume-mute;fas fa-volume-off;fas fa-volume-up;fas fa-walking;fas fa-wallet;fas fa-warehouse;fas fa-weight;fas fa-weight-hanging;fas fa-wheelchair;fas fa-wifi;fas fa-wind;fas fa-window-close;fas fa-window-maximize;fas fa-window-minimize;fas fa-window-restore;fas fa-wine-bottle;fas fa-wine-glass;fas fa-wine-glass-alt;fas fa-won-sign;fas fa-wrench;fas fa-x-ray;fas fa-yen-sign;fas fa-yin-yang;';

        var fasArr = fas.split(';');
        var fasStr = '';
        for (var tmpKey in fasArr) {
            var r = Math.floor(Math.random() * 256);
            var g = Math.floor(Math.random() * 256);
            var b = Math.floor(Math.random() * 256);
            fasStr += '<button title="' + fasArr[tmpKey] + '" class="btn btn-outline-primary" style="margin: 5px 5px 5px 5px;width: 40px;height: 40px;padding:0 0"><i class="' + fasArr[tmpKey] + '" style="font-size: 24px;color:rgb(' + r + ',' + g + ',' + b + ')"></i></button>';
        }

        var loginBox =
            `<div id="_6CAE2298F3DC0481C9B752A5969FDF77" class="col-12 m-auto" style="padding: 10px;">`
            	+ fasStr +
            `</div>`;
        layer.open({
            type: 1,
            title: '选择图标',
            area: ['50%', '50%'],
            content: loginBox,
            // maxmin: true,
            closeBtn: 1,
            anim: 5,
            resize: false,
            success: function (layero, index) {
                $('#_6CAE2298F3DC0481C9B752A5969FDF77').find('button').on('click', function () {
                    var icon = $(this).attr('title');
                    $('#_6CAE2298F3DC0481C9B752A5969FDF77').find('button').unbind();
                    setTimeout(function () {
                        layer.close(index);
                        CB(icon);
                    }, 200);
                });
            },
            cancel: function () {
                $('#_6CAE2298F3DC0481C9B752A5969FDF77').find('button').unbind();
            }
        });
    }

    _Edeye.getMd5 = function (ofile, FUNC) {
    	return new Promise(function (resolve, reject) {
    		var file = ofile;
    		var tmp_md5;
    		var blobSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice,chunkSize = 1 * 1024 * 1024,//1M
    		chunks = Math.ceil(file.size / chunkSize),currentChunk = 0,spark = new SparkMD5.ArrayBuffer(),fileReader = new FileReader();

	        fileReader.onload = function (e) {
	        	spark.append(e.target.result);
	        	currentChunk++;
	        	if (currentChunk < chunks) {
	        		loadNext();
	        	} else {
	        		tmp_md5 = spark.end();
	        		FUNC({name: file.name, size: file.size, md5: tmp_md5});
	        		resolve({name: file.name, size: file.size, md5: tmp_md5});
	        	}
	        };

	        fileReader.onerror = function () {
	        	console.warn('oops, something went wrong.');
	        };

	        function loadNext() {
	        	var start = currentChunk * chunkSize,end = ((start + chunkSize) >= file.size) ? file.size : start + chunkSize;
	        	fileReader.readAsArrayBuffer(blobSlice.call(file, start, end));
	        }

	        loadNext();
    	});
    }

    _Edeye.zip = function (obj) {
		var binaryString = pako.gzip(encodeURIComponent(JSON.stringify(obj)), {to: 'string'});
		var btoaString = btoa(binaryString);
		var retString = btoaString.replace(/\//g, '@');
		// var retString = btoaString;
		return retString;
    }

    _Edeye.unzip = function (b64Data) {
    	var retString = b64Data.replace(/@/g, '/');
    	// var retString = b64Data;
    	var strData = '';
    	try {
    		strData = atob(retString);
    	} catch (err) {
    		console.log('参数被篡改无法unzip');
    		return undefined;
    	}
    	// let strData = atob(retString);
    	// Convert binary string to character-number array
    	var charData = strData.split('').map(function (x) {
    		return x.charCodeAt(0);
    	});
		// Turn number array into byte-array
		var binData = new Uint8Array(charData);
		// // unzip
		var data = pako.inflate(binData);
		// Convert gunzipped byteArray back to ascii string:
		strData = String.fromCharCode.apply(null, new Uint16Array(data));
		return JSON.parse(decodeURIComponent(strData));
    }

    // ############# admin template start #############

    // ############# admin table pc start #############

    _Edeye.getDataTableAll = function (tableId) {
        var ret = [];
        $("input[id^='" + tableId + "_8D777F385D3DFEC8815D20F7496026DC_']").each(function () {
            ret.push(JSON.parse($(this).val()));
        });
        return ret;
    }

    _Edeye.getDataTableByKey = function (tableId, ids) {
        var ret = [];
        if (typeof(ids) === 'object' && ids.constructor === Array) {
            for (var tmpKey in ids) {
                var tmpData = $("input[id='" + tableId + "_8D777F385D3DFEC8815D20F7496026DC_" + ids[tmpKey] + "']").val();
                if (tmpData != undefined) {
                    ret.push(JSON.parse(tmpData))
                }
            }
        }
        if (typeof(ids) === 'number' || typeof(ids) === 'string') {
            var tmpData = $("input[id='" + tableId + "_8D777F385D3DFEC8815D20F7496026DC_" + ids + "']").val();
            if (tmpData != undefined) {
                ret.push(JSON.parse(tmpData))
            }
        }
        return ret;
    }

    _Edeye.getDataTableSelect = function (tableId) {
        var ids = [];
        $("input[id^='" + tableId + "_E86EC8EFEC98C2D9FD433F383CC4FC79_']").each(function () {
            if ($(this)[0].checked) {
                var idString = $(this).attr('id');
                ids.push(idString.substring((tableId + '_E86EC8EFEC98C2D9FD433F383CC4FC79_').length, idString.length));
            }
        });
        return this.getDataTableByKey(tableId, ids);
    }

    _Edeye.editDataTable = function (param, newData) {
        // debugger;
        var checkboxPosition = (param.checkbox || param.checkbox === undefined) ? 1 : 0;
        var cols = param.column;
        var funcs = {};
        var colKey = '';
        for (var tmpKey in cols) {
            var col = cols[tmpKey];
            if (col.type === 'key') {
                colKey = col.mapping;
            }
            if (col.type === 'function' || col.type === 'func') {
                funcs[tmpKey] = col.func;
            }
        }
        $("input[id='" + param.id + "_8D777F385D3DFEC8815D20F7496026DC_" + newData[colKey] + "']").val(JSON.stringify(newData));

        var targetTds = $("#" + param.id + "_E7D707A26E7F7B6FF52C489C60E429B1_" + newData[colKey] + ' td');
        var showCols = cols.map(function (value) {
            if (value.show || value.show === undefined) {
            	var ret = {
					dataTdStyle: (value.dataTdStyle === undefined ? '' : value.dataTdStyle),
					dataDivStyle: (value.dataDivStyle === undefined ? '' : value.dataDivStyle),
					show: (value.show === undefined ? true : value.show),
					type: value.type,
					title: (value.title === undefined ? value.mapping : value.title),
					mapping: value.mapping,
					trans: value.trans
            	};
                return ret;
            }
        }).filter(function (val) {
            return !(!val || val === "");
        });

//        if (col.show || col.show === undefined) {
//            colTitles.push({
//                dataTdStyle: (col.dataTdStyle === undefined ? '' : col.dataTdStyle),
//                dataDivStyle: (col.dataDivStyle === undefined ? '' : col.dataDivStyle),
//                show: (col.show === undefined ? true : col.show),
//                type: col.type,
//                title: (col.title === undefined ? col.mapping : col.title),
//                mapping: col.mapping,
//                trans: col.trans
//            });
//        }

        var tableId = param.id + '_AAB9E1DE16F38176F86D7A92BA337A8D';

        for (var tmpKey in showCols) {
            var colInstead = showCols[tmpKey];
            var tdLine = targetTds[(parseInt(tmpKey) + checkboxPosition)];
            if (colInstead.type === 'rowNum') {
                continue;
            } else if (colInstead.type === 'function' || colInstead.type === 'func') {
                // 必须先去掉旧的已绑定的方法,然后在新增方法,否则会有内存泄漏
                $(tdLine).find('button').unbind();
                var funcHtml = `<div` + (colInstead.dataDivStyle.length > 0 ? (' style="' + colInstead.dataDivStyle + '"') : ('')) + `>`;
                var btnFuncs = funcs['' + (parseInt(tmpKey, 10) + 1)];
                for (var tmpInInerKey in btnFuncs) {
                    var singleFunc = btnFuncs[tmpInInerKey];
                    var showSingleFunc = false;
                    if (typeof(singleFunc.show) === 'undefined') {
                        showSingleFunc = true;
                    } else if (typeof(singleFunc.show) === 'function') {
                        showSingleFunc = singleFunc.show(newData);
                        if (typeof(showSingleFunc) != 'boolean') {
                            showSingleFunc = false;
                        }
                    } else if (typeof(singleFunc.show) === 'boolean') {
                        showSingleFunc = singleFunc.show;
                    }
                    if (showSingleFunc) {
                        funcHtml += `
							<button id='` + param.id + `_7DF4935F4A5A2865191EF74F64DF8754_` + (parseInt(tmpKey, 10) + 1) + `_` + tmpInInerKey + `_` + newData[colKey] + `' title="` + singleFunc.title + `" type="button" class="btn ` + singleFunc.css + `" style="margin: 2px;` + (singleFunc.style ===  undefined ? '' : singleFunc.style) + `">
								` + singleFunc.text + `
							</button>
						`;
                    }
                }
                funcHtml += `</div>`;
                $(tdLine).html(funcHtml);
                $(tdLine).find('button').on('click', function (e) {
                    var id = $(this).attr('id');
                    var idParts = id.split('_');
                    if (idParts.length === 5 && idParts[1] === '7DF4935F4A5A2865191EF74F64DF8754') {
                        var funcDataParam = JSON.parse($('#' + idParts[0] + '_8D777F385D3DFEC8815D20F7496026DC_' + idParts[4]).val());

    					// 19-02-19 10:22:00 隐藏列时会出现bug改成如下
                        // funcs[idParts[2]][idParts[3]].func(funcDataParam);
                        funcs[Object.keys(colFuncs)[0]][idParts[3]].func(funcDataParam);
                    }
                });
            } else {
                var htmlData = newData[colInstead.mapping];
                if (typeof(colInstead.trans) === 'function') {
                    // htmlData = colInstead.trans(newData[colInstead.mapping]);
                	// 直接将整条数据映射过去
                    htmlData = colInstead.trans(newData);
                }
                $(tdLine).html(htmlData);
            }
        }

        if(checkboxPosition > 0){
        	EdeyeAdmin.checkbox(param.id + '_A8990C7893FF039C5AD97CD1DD062706',param.id + '_7FA50423702B3863D76495FFC8117CE7','CHECKNULL');
        }
    }

    var initDataTableMenu = function (param, pageData) {
        var checkboxFlag = param.checkbox || param.checkbox === undefined;
        var checkboxTdStyle = (param.checkboxTdStyle === undefined) ? 'width: 50px;' : param.checkboxTdStyle;
        var cols = param.column;
        var colTitles = [];
        for (var tmpKey in cols) {
            var col = cols[tmpKey];
            if (col.show || col.show === undefined) {
                colTitles.push({
                    titleTdStyle: (col.titleTdStyle === undefined ? '' : col.titleTdStyle),
                    titleDivStyle: (col.titleDivStyle === undefined ? '' : col.titleDivStyle),
                    show: (col.show === undefined ? true : col.show),
                    type: col.type,
                    title: (col.title === undefined ? col.mapping : col.title),
                    mapping: col.mapping,
                    trans: col.trans
                });
            }
        }
        var colTitleHtml = `<tr>`;
        if (checkboxFlag) {
            colTitleHtml += `
				<th style="text-align: center;vertical-align: middle;` + checkboxTdStyle + `">
					<div style="width:0px;" class="pretty p-icon p-rotate p-bigger">
						<input class="` + param.id + `_A8990C7893FF039C5AD97CD1DD062706" type="checkbox" />
						<div class="state">
							<i class="icon fas fa-check-square" style="color: limegreen"></i><label></label>
						</div>
					</div>
				</th>
			`;
        }
        for (var tmpKey in colTitles) {
            colTitleHtml += `
				<th style="vertical-align: middle;` + colTitles[tmpKey].titleTdStyle + `">
					<div` + (colTitles[tmpKey].titleDivStyle.length > 0 ? (' style="' + colTitles[tmpKey].titleDivStyle + '"') : (' ')) + `>
						` + colTitles[tmpKey].title + `
					</div>
				</th>
			`;
        }
        colTitleHtml += `</tr>`;
        var tableId = param.id + '_AAB9E1DE16F38176F86D7A92BA337A8D';
        $('#' + param.id).append(`
			<div class="col-12 mt-3">
				<table id="` + tableId + `" class="table table-sm table-hover table-bordered">
					<tbody>
						` + colTitleHtml + `
					</tbody>
				</table>
			</div>
		`);
    }

    _Edeye.setDataTableData = function (param, pageData) {
        var tableId = param.id + '_AAB9E1DE16F38176F86D7A92BA337A8D';
        var checkboxFlag = param.checkbox || param.checkbox === undefined;
        var checkboxTdStyle = (param.checkboxTdStyle === undefined) ? 'width: 50px;' : param.checkboxTdStyle;
        var trs = $('#' + tableId + ' tbody tr');
        if (trs.length > 1) {
            // 清除事件绑定
            trs.find('button').unbind();
            if (checkboxFlag) {
                $('.' + param.id + '_A8990C7893FF039C5AD97CD1DD062706').unbind();
                $('.' + param.id + '_7FA50423702B3863D76495FFC8117CE7').unbind();
            }
            // 清空数据
            trs.not(":eq(0)").remove();
        }

        if (pageData.data.length > 0) {
            var cols = param.column;
            var colKey = '';
            var colTitles = [];
            var colFuncs = {};
            for (var tmpKey in cols) {
                var col = cols[tmpKey];
                if (col.type === 'key') {
                    colKey = col.mapping;
                }
                if (col.show || col.show === undefined) {
                    colTitles.push({
                        dataTdStyle: (col.dataTdStyle === undefined ? '' : col.dataTdStyle),
                        dataDivStyle: (col.dataDivStyle === undefined ? '' : col.dataDivStyle),
                        show: (col.show === undefined ? true : col.show),
                        type: col.type,
                        title: (col.title === undefined ? col.mapping : col.title),
                        mapping: col.mapping,
                        trans: col.trans
                    });
                }
                if (col.type === 'function' || col.type === 'func') {
                    colFuncs[tmpKey] = col.func;
                }
            }

            var colDataHtml = ``;
            var colDataLines = pageData.data;
            var rowNumPosition = 0;
            for (var tmpKey in colDataLines) {
                var singleColData = colDataLines[tmpKey];
                colDataHtml += `<tr id='` + param.id + '_E7D707A26E7F7B6FF52C489C60E429B1_' + singleColData[colKey] + `'>`;
                colDataHtml += `<input type='hidden' id='` + param.id + '_8D777F385D3DFEC8815D20F7496026DC_' + singleColData[colKey] + `' value='` + JSON.stringify(singleColData) + `'>`;
                if (checkboxFlag) {
                    colDataHtml += `
						<td style="text-align: center;vertical-align: middle;` + checkboxTdStyle + `">
							<div style="width:0px;" class="pretty p-icon p-rotate p-bigger">
								<input id="` + param.id + '_E86EC8EFEC98C2D9FD433F383CC4FC79_' + singleColData[colKey] + `" class="` + param.id + `_7FA50423702B3863D76495FFC8117CE7" type="checkbox" />
								<div class="state">
									<i class="icon fas fa-check-square" style="color: cornflowerblue"></i>
									<label></label>
								</div>
							</div>
						</td>
					`;
                }
                rowNumPosition++;
                for (var tmpInnerKey in colTitles) {
                    var colTitle = colTitles[tmpInnerKey];
                    if (colTitle.type === 'rowNum') {
                        colDataHtml += `
							<td style="vertical-align: middle;` + colTitle.dataTdStyle + `">
								<div` + (colTitle.dataDivStyle.length > 0 ? (' style="' + colTitle.dataDivStyle + '"') : (' ')) + `>`
                            + (((pageData.currentPage - 1) * pageData.pageSize) + rowNumPosition) +
                            `</div>
							</td>
						`;
                    } else if (colTitle.type === 'function' || colTitle.type === 'func') {
                        var funcHtml = `<div` + (colTitle.dataDivStyle.length > 0 ? (' style="' + colTitle.dataDivStyle + '"') : (' ')) + `>`;
                        var btnFuncs = colFuncs['' + (parseInt(tmpInnerKey, 10) + 1)];
                        for (var tmpInInerKey in btnFuncs) {
                            var singleFunc = btnFuncs[tmpInInerKey];
                            var showSingleFunc = false;
                            if (typeof(singleFunc.show) === 'undefined') {
                                showSingleFunc = true;
                            } else if (typeof(singleFunc.show) === 'function') {
                                showSingleFunc = singleFunc.show(singleColData);
                                if (typeof(showSingleFunc) != 'boolean') {
                                    showSingleFunc = false;
                                }
                            } else if (typeof(singleFunc.show) === 'boolean') {
                                showSingleFunc = singleFunc.show;
                            }
                            if (showSingleFunc) {
                                funcHtml += `
									<button id='` + param.id + `_7DF4935F4A5A2865191EF74F64DF8754_` + (parseInt(tmpInnerKey, 10) + 1) + `_` + tmpInInerKey + `_` + singleColData[colKey] + `' title="` + singleFunc.title + `" type="button" class="btn ` + singleFunc.css + `" style="margin: 2px;` + (singleFunc.style ===  undefined ? '' : singleFunc.style) + `">
										` + singleFunc.text + `
									</button>
								`;
                            }
                        }
                        funcHtml += `</div>`;
                        colDataHtml += `
							<td style="vertical-align: middle;` + colTitle.dataTdStyle + `">
								` + funcHtml + `
							</td>
						`;
                    } else {
                        var htmlData = singleColData[colTitle.mapping];
                        if (typeof(colTitle.trans) === 'function') {
                            // htmlData = colTitle.trans(singleColData[colTitle.mapping]);
                        	// 直接将整条数据映射过去
                            htmlData = colTitle.trans(singleColData);
                        }
                        if(htmlData === undefined){
                        	htmlData = '';
                        }
                        colDataHtml += `
							<td style="vertical-align: middle;` + colTitle.dataTdStyle + `">
								<div>`
	                            	+ htmlData +
	                            `</div>
							</td>
						`;
                        /**
                         * 给TD添加title属性，便于添加过滤后查看全面信息
                         * @author	Veigar
                         * @data	2019年1月3日
                         */
//                        colDataHtml += `
//							<td title="${singleColData[colTitle.mapping]}" style="vertical-align: middle;` + colTitle.dataTdStyle + `">
//								<div` + (colTitle.dataDivStyle.length > 0 ? (' style="' + colTitle.dataDivStyle + '"') : (' ')) + `>`
//                            + htmlData +
//                            `</div>
//							</td>
//						`;
					}
				}


				colDataHtml += '</tr>';
			}
			$('#' + param.id + '_AAB9E1DE16F38176F86D7A92BA337A8D tbody').append(colDataHtml);

			EdeyeAdmin.checkbox(param.id + '_A8990C7893FF039C5AD97CD1DD062706',param.id + '_7FA50423702B3863D76495FFC8117CE7','BIND');

			$('#' + tableId + ' button').on('click',function(e){
				var id = $(this).attr('id');
				var idParts = id.split('_');
				if(idParts.length === 5 && idParts[1] === '7DF4935F4A5A2865191EF74F64DF8754'){
					var funcDataParam = JSON.parse($('#' + idParts[0] + '_8D777F385D3DFEC8815D20F7496026DC_' + idParts[4]).val());
					colFuncs[idParts[2]][idParts[3]].func(funcDataParam);
				}
			});
		}

		if($('.' + param.id +`_A8990C7893FF039C5AD97CD1DD062706`).length > 0){
			$('.' + param.id +`_A8990C7893FF039C5AD97CD1DD062706`)[0].checked = false;
			$('.' + param.id +`_A8990C7893FF039C5AD97CD1DD062706`).attr("checked", false);
		}

		setDataTablePagination(param,pageData);
	}

    _Edeye.getPageSize = function(id){
		return $('#' + id +`_9E477E527D65BD58203B92442C29B87F`).val();
	}

	var setDataTablePagination = function(param,pageData){
		if($('#' + param.id + '_EEA66C339AE57AA8E07623F1FB37328C').length === 0){
			$('#' + param.id).append(`
				<div id="` + param.id +`_EEA66C339AE57AA8E07623F1FB37328C" class="col-12 mb-3" style="display:none">
					<span>没有检索到数据</span>
				</div>
			`);
        }
        $('#' + param.id + '_EEA66C339AE57AA8E07623F1FB37328C').css('display', (pageData.data.length > 0 ? 'none' : 'block'));

        var pageSizeOptionConfig = (param.pageSize === undefined ? [5,[10],20,50,100,200,500,1000] : param.pageSize);
        var pageSizeOptionHtml = '';
        for(var tmpKey in pageSizeOptionConfig){
        	var tpf = typeof(pageSizeOptionConfig[tmpKey]);
        	if(tpf === 'number'){
        		pageSizeOptionHtml += `<option value="` + pageSizeOptionConfig[tmpKey] + `">` + pageSizeOptionConfig[tmpKey] + `</option>`;
        	}else{
        		pageSizeOptionHtml += `<option value="` + pageSizeOptionConfig[tmpKey] + `" selected="">` + pageSizeOptionConfig[tmpKey] + `</option>`;
        	}
        }

        if ($('#' + param.id + '_FE7CD4D1BF3FEA9A0D921E224B3FA24C').length === 0) {
            $('#' + param.id).append(`
				<div class="col-12">
					<div class="row" id="` + param.id + `_FE7CD4D1BF3FEA9A0D921E224B3FA24C">
						<div class="col-6">
							<ul class="pagination pagination-sm">
								<li class="page-item" style="padding-right:10px;">
									<select id="` + param.id +`_9E477E527D65BD58203B92442C29B87F" class="custom-select custom-select-sm" style="border-radius: 0px;min-width: 70px;width: 70px;">
									  ` + pageSizeOptionHtml + `
									</select>
								</li>
								<li id="` + param.id + `_B544033A510E88F9FD2E57477DD159D6" class="page-item disabled" style="cursor: pointer;">
									<a class="page-link" href="javascript:;"><i class="fas fa-step-backward"></i></a>
								</li>
								<li id="` + param.id + `_4E7B25AA1ECF24D701D2400C0A16EC71" class="page-item disabled" style="cursor: pointer;">
									<a class="page-link" href="javascript:;"><i class="fas fa-caret-left fa-lg"></i></a>
								</li>
								<li class="page-item disabled" style="cursor: pointer;">
									<div class="input-group input-group-sm">
										<input id="` + param.id + `_6D9AC9408AC2CED0CDA3E0080099CAD5" value="5" type="text" class="form-control" style="width:50px;border-radius:0em;border-left: 0px solid white;border-right: 0px solid white;">
										<!--
										<div class="input-group-append">
											<span class="input-group-text" style="border-radius: 0px;border-left: 1px solid white;border-right: 1px solid white;">GO</span>
										</div>
										-->
									</div>
								</li>
								<li id="` + param.id + `_8DD511B6D7CCE85142B784AF90ECBF74" class="page-item disabled" style="cursor: pointer;">
									<a class="page-link" href="javascript:;"><i class="fas fa-caret-right fa-lg"></i></a>
								</li>
								<li id="` + param.id + `_5147B0AED3B7D961E930084FAB5491E1" class="page-item disabled" style="cursor: pointer;padding-right:10px;">
									<a class="page-link" href="javascript:;"><i class="fas fa-step-forward"></i></a>
								</li>
							</ul>
						</div>
						<div class="col-6 float-right">
							<ul class="pagination pagination-sm float-right">
								<li class="page-item disabled">
									<span id="` + param.id + `_749C645D0898B183B7C2B501ADDC5EBC" class="page-link" style="border:0px;">第?/?页,共?条数据</span>
								</li>
							</ul>
						</div>
					</div>
				</div>
			`);
        }

		if(pageData.currentPage > pageData.totalPageNum){
			$('#' + param.id + '_B544033A510E88F9FD2E57477DD159D6').attr("class","page-item" + (pageData.currentPage === 1 ? ' disabled' : ''));
			$('#' + param.id + '_4E7B25AA1ECF24D701D2400C0A16EC71').attr("class","page-item" + (pageData.currentPage === 1 ? ' disabled' : ''));
			$('#' + param.id + '_6D9AC9408AC2CED0CDA3E0080099CAD5').val(pageData.currentPage);
			$('#' + param.id + '_8DD511B6D7CCE85142B784AF90ECBF74').attr("class","page-item disabled");
			$('#' + param.id + '_5147B0AED3B7D961E930084FAB5491E1').attr("class","page-item disabled");
			$('#' + param.id + '_749C645D0898B183B7C2B501ADDC5EBC').html('第<span>' + pageData.currentPage + '</span>/<span>' + pageData.totalPageNum + '</span>页,共' + pageData.totalDataNum + '条数据');
		}else if(pageData.currentPage == parseInt(pageData.totalPageNum) && pageData.currentPage == 1){
			$('#' + param.id + '_B544033A510E88F9FD2E57477DD159D6').attr("class","page-item disabled");
			$('#' + param.id + '_4E7B25AA1ECF24D701D2400C0A16EC71').attr("class","page-item disabled");
			$('#' + param.id + '_6D9AC9408AC2CED0CDA3E0080099CAD5').val(pageData.currentPage);
			$('#' + param.id + '_8DD511B6D7CCE85142B784AF90ECBF74').attr("class","page-item disabled");
			$('#' + param.id + '_5147B0AED3B7D961E930084FAB5491E1').attr("class","page-item disabled");
			$('#' + param.id + '_749C645D0898B183B7C2B501ADDC5EBC').html('第<span>' + pageData.currentPage + '</span>/<span>' + pageData.totalPageNum + '</span>页,共' + pageData.totalDataNum + '条数据');
		}else{
			$('#' + param.id + '_B544033A510E88F9FD2E57477DD159D6').attr("class","page-item" + (pageData.currentPage === 1 ? ' disabled' : ''));
			$('#' + param.id + '_4E7B25AA1ECF24D701D2400C0A16EC71').attr("class","page-item" + (pageData.currentPage === 1 ? ' disabled' : ''));
			$('#' + param.id + '_6D9AC9408AC2CED0CDA3E0080099CAD5').val(pageData.currentPage);
			$('#' + param.id + '_8DD511B6D7CCE85142B784AF90ECBF74').attr("class","page-item" + (pageData.currentPage === pageData.totalPageNum ? ' disabled' : ''));
			$('#' + param.id + '_5147B0AED3B7D961E930084FAB5491E1').attr("class","page-item" + (pageData.currentPage === pageData.totalPageNum ? ' disabled' : ''));
			$('#' + param.id + '_749C645D0898B183B7C2B501ADDC5EBC').html('第<span>' + pageData.currentPage + '</span>/<span>' + pageData.totalPageNum + '</span>页,共' + pageData.totalDataNum + '条数据');
		}

		var firstPageClickEvent = $._data($('#' + param.id + '_B544033A510E88F9FD2E57477DD159D6')[0],'events');
		if(firstPageClickEvent === undefined){
			$('#' + param.id + '_B544033A510E88F9FD2E57477DD159D6').on('click',function(e){
				if($(this).attr('class') === 'page-item disabled'){
					return;
				}

				var ct = $('#' + param.id +`_749C645D0898B183B7C2B501ADDC5EBC`).children(":first").text();
				var ps = $('#' + param.id +`_9E477E527D65BD58203B92442C29B87F`).val();
				var ret = param.page('first',ct,ps);
			});
		}
		var prevPageClickEvent = $._data($('#' + param.id + '_4E7B25AA1ECF24D701D2400C0A16EC71')[0],'events');
		if(prevPageClickEvent === undefined){
			$('#' + param.id + '_4E7B25AA1ECF24D701D2400C0A16EC71').on('click',function(e){
				if($(this).attr('class') === 'page-item disabled'){
					return;
				}

				var ct = $('#' + param.id +`_749C645D0898B183B7C2B501ADDC5EBC`).children(":first").text();
				var ps = $('#' + param.id +`_9E477E527D65BD58203B92442C29B87F`).val();
				var ret = param.page('prev',ct,ps);
			});
		}
		var currentPageClickEvent = $._data($('#' + param.id + '_6D9AC9408AC2CED0CDA3E0080099CAD5')[0],'events');
		if(currentPageClickEvent !== undefined){
			$('#' + param.id + '_6D9AC9408AC2CED0CDA3E0080099CAD5').unbind();
		}

		$('#' + param.id + '_6D9AC9408AC2CED0CDA3E0080099CAD5').on('keydown',function(e){
			if (e.keyCode == 13) {
				let checkRet = EdeyeAdmin.checkKit.finalCheck({
			    	'name': $('#' + param.id + '_6D9AC9408AC2CED0CDA3E0080099CAD5').val()
			    }, true, {
			        'name': {
			            method: 'integerRange',
			            methodParam: ['&&', ['>=', 1], ['<=', pageData.totalPageNum]],
			            msg: '查询页不在正常范围值'
			        }
			    });
			    if (!checkRet.flag) {
			    	checkMsg = (checkRet.msg.join('<br />'));
		            EdeyeAdmin.closeMsg(checkMsg,true,3);
		            return;
			    }

				// var ct = $('#' + param.id +`_749C645D0898B183B7C2B501ADDC5EBC`).children(":first").text();
				var ct = $('#' + param.id +`_6D9AC9408AC2CED0CDA3E0080099CAD5`).val();
				var ps = $('#' + param.id +`_9E477E527D65BD58203B92442C29B87F`).val();
			    // var ret = param.page('goto',pageData.ct,ps);
			    var ret = param.page('goto',ct,ps);
			}
		});

		var nextPageClickEvent = $._data($('#' + param.id + '_8DD511B6D7CCE85142B784AF90ECBF74')[0],'events');
		if(nextPageClickEvent === undefined){
			$('#' + param.id + '_8DD511B6D7CCE85142B784AF90ECBF74').on('click',function(e){
				if($(this).attr('class') === 'page-item disabled'){
					return;
				}

				var ct = $('#' + param.id +`_749C645D0898B183B7C2B501ADDC5EBC`).children(":first").text();
				var ps = $('#' + param.id +`_9E477E527D65BD58203B92442C29B87F`).val();
				var ret = param.page('next',ct,ps);
			});
		}
		var lastPageClickEvent = $._data($('#' + param.id + '_5147B0AED3B7D961E930084FAB5491E1')[0],'events');
		if(lastPageClickEvent === undefined){
			$('#' + param.id + '_5147B0AED3B7D961E930084FAB5491E1').on('click',function(e){
				if($(this).attr('class') === 'page-item disabled'){
					return;
				}

				var ct = $('#' + param.id +`_749C645D0898B183B7C2B501ADDC5EBC`).children(":first").text();
				var ps = $('#' + param.id +`_9E477E527D65BD58203B92442C29B87F`).val();
				var tpn = $('#' + param.id +`_749C645D0898B183B7C2B501ADDC5EBC`).children(":eq(1)").text();
				var ret = param.page('last',ct,ps,tpn);
			});
		}

		// $('#' + param.id + '_9E477E527D65BD58203B92442C29B87F').find("option:contains('" + pageData.pageSize + "')").attr("selected",true);
		var pageSizeEvent = $._data($('#' + param.id + '_9E477E527D65BD58203B92442C29B87F')[0],'events');
		if(pageSizeEvent === undefined){
			$('#' + param.id + '_9E477E527D65BD58203B92442C29B87F').on('change',function(e){
				if($(this).attr('class') === 'page-item disabled'){
					return;
				}

				var ct = $('#' + param.id +`_749C645D0898B183B7C2B501ADDC5EBC`).children(":first").text();
				var ps = $('#' + param.id +`_9E477E527D65BD58203B92442C29B87F`).val();
				var tpn = $('#' + param.id +`_749C645D0898B183B7C2B501ADDC5EBC`).children(":eq(1)").text();
				var ret = param.page('change',ct,ps,tpn);
				// var ret = param.page('change',ct,$('#' + param.id + '_9E477E527D65BD58203B92442C29B87F').val(),tpn);
			});
		}
	}

	_Edeye.initDataTable = function(param,pageData){
		initDataTableMenu(param,pageData);
		this.setDataTableData(param,pageData);
	}

    // ############# admin table pc end #############

    // ############# admin table phone start #############

    _Edeye.getDataTableAllPhone = function (tableId) {
        var ret = [];
        $("input[id^='" + tableId + "_8D777F385D3DFEC8815D20F7496026DC_']").each(function () {
            ret.push(JSON.parse($(this).val()));
        });
        return ret;
    }

    _Edeye.getDataTableByKeyPhone = function (tableId, ids) {
        var ret = [];
        if (typeof(ids) === 'object' && ids.constructor === Array) {
            for (var tmpKey in ids) {
                var tmpData = $("input[id='" + tableId + "_8D777F385D3DFEC8815D20F7496026DC_" + ids[tmpKey] + "']").val();
                if (tmpData != undefined) {
                    ret.push(JSON.parse(tmpData))
                }
            }
        }
        if (typeof(ids) === 'number' || typeof(ids) === 'string') {
            var tmpData = $("input[id='" + tableId + "_8D777F385D3DFEC8815D20F7496026DC_" + ids + "']").val();
            if (tmpData != undefined) {
                ret.push(JSON.parse(tmpData))
            }
        }
        return ret;
    }

    _Edeye.getDataTableSelectPhone = function (tableId) {
        var ids = [];
        $("input[id^='" + tableId + "_E86EC8EFEC98C2D9FD433F383CC4FC79_']").each(function () {
            if ($(this)[0].checked) {
                var idString = $(this).attr('id');
                ids.push(idString.substring((tableId + '_E86EC8EFEC98C2D9FD433F383CC4FC79_').length, idString.length));
            }
        });
        return this.getDataTableByKeyPhone(tableId, ids);
    }

    _Edeye.editDataTablePhone = function (param, newData) {
        // debugger;
        var checkboxPosition = (param.checkbox || param.checkbox === undefined) ? 1 : 0;
        var cols = param.column;
        var funcs = {};
        var colKey = '';
        for (var tmpKey in cols) {
            var col = cols[tmpKey];
            if (col.type === 'key') {
                colKey = col.mapping;
            }
            if (col.type === 'function' || col.type === 'func') {
                funcs[tmpKey] = col.func;
            }
        }
        $("input[id='" + param.id + "_8D777F385D3DFEC8815D20F7496026DC_" + newData[colKey] + "']").val(JSON.stringify(newData));

        var targetTds = $("#" + param.id + "_E7D707A26E7F7B6FF52C489C60E429B1_" + newData[colKey] + ' td');
        var showCols = cols.map(function (value) {
            if (value.show || value.show === undefined) {
            	var ret = {
					dataTdStyle: (value.dataTdStyle === undefined ? '' : value.dataTdStyle),
					dataDivStyle: (value.dataDivStyle === undefined ? '' : value.dataDivStyle),
					show: (value.show === undefined ? true : value.show),
					type: value.type,
					title: (value.title === undefined ? value.mapping : value.title),
					mapping: value.mapping,
					trans: value.trans
            	};
                return ret;
            }
        }).filter(function (val) {
            return !(!val || val === "");
        });

//        if (col.show || col.show === undefined) {
//            colTitles.push({
//                dataTdStyle: (col.dataTdStyle === undefined ? '' : col.dataTdStyle),
//                dataDivStyle: (col.dataDivStyle === undefined ? '' : col.dataDivStyle),
//                show: (col.show === undefined ? true : col.show),
//                type: col.type,
//                title: (col.title === undefined ? col.mapping : col.title),
//                mapping: col.mapping,
//                trans: col.trans
//            });
//        }

        var tableId = param.id + '_AAB9E1DE16F38176F86D7A92BA337A8D';

        for (var tmpKey in showCols) {
            var colInstead = showCols[tmpKey];
            var tdLine = targetTds[(parseInt(tmpKey) + checkboxPosition)];
            if (colInstead.type === 'rowNum') {
                continue;
            } else if (colInstead.type === 'function' || colInstead.type === 'func') {
                // 必须先去掉旧的已绑定的方法,然后在新增方法,否则会有内存泄漏
                $(tdLine).find('button').unbind();
                var funcHtml = `<div` + (colInstead.dataDivStyle.length > 0 ? (' style="' + colInstead.dataDivStyle + '"') : ('')) + `>`;
                // var btnFuncs = funcs['' + (parseInt(tmpKey, 10) + 1)];
                // 19-02-19 10:22:00 隐藏列时会出现bug改成如下
                var btnFuncs = funcs[Object.keys(colFuncs)[0]];
                for (var tmpInInerKey in btnFuncs) {
                    var singleFunc = btnFuncs[tmpInInerKey];
                    var showSingleFunc = false;
                    if (typeof(singleFunc.show) === 'undefined') {
                        showSingleFunc = true;
                    } else if (typeof(singleFunc.show) === 'function') {
                        showSingleFunc = singleFunc.show(newData);
                        if (typeof(showSingleFunc) != 'boolean') {
                            showSingleFunc = false;
                        }
                    } else if (typeof(singleFunc.show) === 'boolean') {
                        showSingleFunc = singleFunc.show;
                    }
                    if (showSingleFunc) {
                        funcHtml += `
							<button id='` + param.id + `_7DF4935F4A5A2865191EF74F64DF8754_` + (parseInt(tmpKey, 10) + 1) + `_` + tmpInInerKey + `_` + newData[colKey] + `' title="` + singleFunc.title + `" type="button" class="btn ` + singleFunc.css + `" style="margin: 2px;` + (singleFunc.style ===  undefined ? '' : singleFunc.style) + `">
								` + singleFunc.text + `
							</button>
						`;
                    }
                }
                funcHtml += `</div>`;
                $(tdLine).html(funcHtml);
                $(tdLine).find('button').on('click', function (e) {
                    var id = $(this).attr('id');
                    var idParts = id.split('_');
                    if (idParts.length === 5 && idParts[1] === '7DF4935F4A5A2865191EF74F64DF8754') {
                        var funcDataParam = JSON.parse($('#' + idParts[0] + '_8D777F385D3DFEC8815D20F7496026DC_' + idParts[4]).val());
                        funcs[idParts[2]][idParts[3]].func(funcDataParam);
                    }
                });
            } else {
                var htmlData = newData[colInstead.mapping];
                if (typeof(colInstead.trans) === 'function') {
                    // htmlData = colInstead.trans(newData[colInstead.mapping]);
                	// 直接将整条数据映射过去
                    htmlData = colInstead.trans(newData);
                }
                $(tdLine).html(htmlData);
            }
        }

        if(checkboxPosition > 0){
        	EdeyeAdmin.checkbox(param.id + '_A8990C7893FF039C5AD97CD1DD062706',param.id + '_7FA50423702B3863D76495FFC8117CE7','CHECKNULL');
        }
    }

    var initDataTableMenuPhone = function (param, pageData) {
        var checkboxFlag = param.checkbox || param.checkbox === undefined;
        var checkboxTdStyle = (param.checkboxTdStyle === undefined) ? 'width: 50px;' : param.checkboxTdStyle;
        var cols = param.column;
        var colTitles = [];
        for (var tmpKey in cols) {
            var col = cols[tmpKey];
            if (col.show || col.show === undefined) {
                colTitles.push({
                    titleTdStyle: (col.titleTdStyle === undefined ? '' : col.titleTdStyle),
                    titleDivStyle: (col.titleDivStyle === undefined ? '' : col.titleDivStyle),
                    show: (col.show === undefined ? true : col.show),
                    type: col.type,
                    title: (col.title === undefined ? col.mapping : col.title),
                    mapping: col.mapping,
                    trans: col.trans
                });
            }
        }
        var colTitleHtml = `<tr>`;
        if (checkboxFlag) {
            colTitleHtml += `
				<th style="text-align: center;vertical-align: middle;` + checkboxTdStyle + `">
					<div style="width:0px;" class="pretty p-icon p-rotate p-bigger">
						<input class="` + param.id + `_A8990C7893FF039C5AD97CD1DD062706" type="checkbox" />
						<div class="state">
							<i class="icon fas fa-check-square" style="color: limegreen"></i><label></label>
						</div>
					</div>
				</th>
			`;
        }
        for (var tmpKey in colTitles) {
            colTitleHtml += `
				<th style="vertical-align: middle;` + colTitles[tmpKey].titleTdStyle + `">
					<div` + (colTitles[tmpKey].titleDivStyle.length > 0 ? (' style="' + colTitles[tmpKey].titleDivStyle + '"') : (' ')) + `>
						` + colTitles[tmpKey].title + `
					</div>
				</th>
			`;
        }
        colTitleHtml += `</tr>`;
        var tableId = param.id + '_AAB9E1DE16F38176F86D7A92BA337A8D';
        $('#' + param.id).append(`
			<div class="col-12 mt-3">
				<table id="` + tableId + `" class="table table-sm table-hover table-bordered">
					<tbody>
						` + colTitleHtml + `
					</tbody>
				</table>
			</div>
		`);
    }

    _Edeye.setDataTableDataPhone = function (param, pageData) {
        var tableId = param.id + '_AAB9E1DE16F38176F86D7A92BA337A8D';
        var checkboxFlag = param.checkbox || param.checkbox === undefined;
        var checkboxTdStyle = (param.checkboxTdStyle === undefined) ? 'width: 50px;' : param.checkboxTdStyle;
        var trs = $('#' + tableId + ' tbody tr');
        if (trs.length > 1) {
            // 清除事件绑定
            trs.find('button').unbind();
            if (checkboxFlag) {
                $('.' + param.id + '_A8990C7893FF039C5AD97CD1DD062706').unbind();
                $('.' + param.id + '_7FA50423702B3863D76495FFC8117CE7').unbind();
            }
            // 清空数据
            trs.not(":eq(0)").remove();
        }

        if (pageData.data.length > 0) {
            var cols = param.column;
            var colKey = '';
            var colTitles = [];
            var colFuncs = {};
            for (var tmpKey in cols) {
                var col = cols[tmpKey];
                if (col.type === 'key') {
                    colKey = col.mapping;
                }
                if (col.show || col.show === undefined) {
                    colTitles.push({
                        dataTdStyle: (col.dataTdStyle === undefined ? '' : col.dataTdStyle),
                        dataDivStyle: (col.dataDivStyle === undefined ? '' : col.dataDivStyle),
                        show: (col.show === undefined ? true : col.show),
                        type: col.type,
                        title: (col.title === undefined ? col.mapping : col.title),
                        mapping: col.mapping,
                        trans: col.trans
                    });
                }
                if (col.type === 'function' || col.type === 'func') {
                    colFuncs[tmpKey] = col.func;
                }
            }

            var colDataHtml = ``;
            var colDataLines = pageData.data;
            var rowNumPosition = 0;
            for (var tmpKey in colDataLines) {
                var singleColData = colDataLines[tmpKey];
                colDataHtml += `<tr id='` + param.id + '_E7D707A26E7F7B6FF52C489C60E429B1_' + singleColData[colKey] + `'>`;
                colDataHtml += `<input type='hidden' id='` + param.id + '_8D777F385D3DFEC8815D20F7496026DC_' + singleColData[colKey] + `' value='` + JSON.stringify(singleColData) + `'>`;
                if (checkboxFlag) {
                    colDataHtml += `
						<td style="text-align: center;vertical-align: middle;` + checkboxTdStyle + `">
							<div style="width:0px;" class="pretty p-icon p-rotate p-bigger">
								<input id="` + param.id + '_E86EC8EFEC98C2D9FD433F383CC4FC79_' + singleColData[colKey] + `" class="` + param.id + `_7FA50423702B3863D76495FFC8117CE7" type="checkbox" />
								<div class="state">
									<i class="icon fas fa-check-square" style="color: cornflowerblue"></i>
									<label></label>
								</div>
							</div>
						</td>
					`;
                }
                rowNumPosition++;
                for (var tmpInnerKey in colTitles) {
                    var colTitle = colTitles[tmpInnerKey];
                    if (colTitle.type === 'rowNum') {
                        colDataHtml += `
							<td style="vertical-align: middle;` + colTitle.dataTdStyle + `">
								<div` + (colTitle.dataDivStyle.length > 0 ? (' style="' + colTitle.dataDivStyle + '"') : (' ')) + `>`
                            + (((pageData.currentPage - 1) * pageData.pageSize) + rowNumPosition) +
                            `</div>
							</td>
						`;
                    } else if (colTitle.type === 'function' || colTitle.type === 'func') {
                        var funcHtml = `<div` + (colTitle.dataDivStyle.length > 0 ? (' style="' + colTitle.dataDivStyle + '"') : (' ')) + `>`;
                        // var btnFuncs = colFuncs['' + (parseInt(tmpInnerKey, 10) + 1)];
            			// 19-02-19 10:22:00 隐藏列时会出现bug改成如下
                        var btnFuncs = colFuncs[Object.keys(colFuncs)[0]];
                        for (var tmpInInerKey in btnFuncs) {
                            var singleFunc = btnFuncs[tmpInInerKey];
                            var showSingleFunc = false;
                            if (typeof(singleFunc.show) === 'undefined') {
                                showSingleFunc = true;
                            } else if (typeof(singleFunc.show) === 'function') {
                                showSingleFunc = singleFunc.show(singleColData);
                                if (typeof(showSingleFunc) != 'boolean') {
                                    showSingleFunc = false;
                                }
                            } else if (typeof(singleFunc.show) === 'boolean') {
                                showSingleFunc = singleFunc.show;
                            }
                            if (showSingleFunc) {
                                funcHtml += `
									<button id='` + param.id + `_7DF4935F4A5A2865191EF74F64DF8754_` + (parseInt(tmpInnerKey, 10) + 1) + `_` + tmpInInerKey + `_` + singleColData[colKey] + `' title="` + singleFunc.title + `" type="button" class="btn ` + singleFunc.css + `" style="margin: 2px;` + (singleFunc.style ===  undefined ? '' : singleFunc.style) + `">
										` + singleFunc.text + `
									</button>
								`;
                            }
                        }
                        funcHtml += `</div>`;
                        colDataHtml += `
							<td style="vertical-align: middle;` + colTitle.dataTdStyle + `">
								` + funcHtml + `
							</td>
						`;
                    } else {
                        var htmlData = singleColData[colTitle.mapping];
                        if (typeof(colTitle.trans) === 'function') {
                            // htmlData = colTitle.trans(singleColData[colTitle.mapping]);
                        	// 直接将整条数据映射过去
                            htmlData = colTitle.trans(singleColData);
                        }
                        /**
                         * 给TD添加title属性，便于添加过滤后查看全面信息
                         * @author	Veigar
                         * @data	2019年1月3日
                         */
                        colDataHtml += `
							<td title="${singleColData[colTitle.mapping]}" style="vertical-align: middle;` + colTitle.dataTdStyle + `">
								<div` + (colTitle.dataDivStyle.length > 0 ? (' style="' + colTitle.dataDivStyle + '"') : (' ')) + `>`
                            + htmlData +
                            `</div>
							</td>
						`;
					}
				}


				colDataHtml += '</tr>';
			}
			$('#' + param.id + '_AAB9E1DE16F38176F86D7A92BA337A8D tbody').append(colDataHtml);

			EdeyeAdmin.checkbox(param.id + '_A8990C7893FF039C5AD97CD1DD062706',param.id + '_7FA50423702B3863D76495FFC8117CE7','BIND');

			$('#' + tableId + ' button').on('click',function(e){
				var id = $(this).attr('id');
				var idParts = id.split('_');
				if(idParts.length === 5 && idParts[1] === '7DF4935F4A5A2865191EF74F64DF8754'){
					var funcDataParam = JSON.parse($('#' + idParts[0] + '_8D777F385D3DFEC8815D20F7496026DC_' + idParts[4]).val());

					// 19-02-19 10:22:00 隐藏列时会出现bug改成如下
					// colFuncs[idParts[2]][idParts[3]].func(funcDataParam);
					colFuncs[Object.keys(colFuncs)[0]][idParts[3]].func(funcDataParam);
				}
			});
		}

		if($('.' + param.id +`_A8990C7893FF039C5AD97CD1DD062706`).length > 0){
			$('.' + param.id +`_A8990C7893FF039C5AD97CD1DD062706`)[0].checked = false;
			$('.' + param.id +`_A8990C7893FF039C5AD97CD1DD062706`).attr("checked", false);
		}

		setDataTablePaginationPhone(param,pageData);
	}

    _Edeye.getPageSizePhone = function(id){
		return $('#' + id +`_9E477E527D65BD58203B92442C29B87F`).val();
	}

	var setDataTablePaginationPhone = function(param,pageData){
		if($('#' + param.id + '_EEA66C339AE57AA8E07623F1FB37328C').length === 0){
			$('#' + param.id).append(`
				<div id="` + param.id +`_EEA66C339AE57AA8E07623F1FB37328C" class="col-12 mb-3" style="display:none">
					<span>没有检索到数据</span>
				</div>
			`);
        }
        $('#' + param.id + '_EEA66C339AE57AA8E07623F1FB37328C').css('display', (pageData.data.length > 0 ? 'none' : 'block'));

        var pageSizeOptionConfig = (param.pageSize === undefined ? [5,[10],20,50,100,200,500,1000] : param.pageSize);
        var pageSizeOptionHtml = '';
        for(var tmpKey in pageSizeOptionConfig){
        	var tpf = typeof(pageSizeOptionConfig[tmpKey]);
        	if(tpf === 'number'){
        		pageSizeOptionHtml += `<option value="` + pageSizeOptionConfig[tmpKey] + `">` + pageSizeOptionConfig[tmpKey] + `</option>`;
        	}else{
        		pageSizeOptionHtml += `<option value="` + pageSizeOptionConfig[tmpKey] + `" selected="">` + pageSizeOptionConfig[tmpKey] + `</option>`;
        	}
        }

        var pageConfig_ShowGoNum = '';
        if(param.pageConfig !== undefined){
        	if(param.pageConfig.showGoNum !== undefined){
        		if(param.pageConfig.showGoNum === true){
        		}else if(param.pageConfig.showGoNum === false){
        			pageConfig_ShowGoNum = 'display:none';
        		}
        	}
        }

        if ($('#' + param.id + '_FE7CD4D1BF3FEA9A0D921E224B3FA24C').length === 0) {
            $('#' + param.id).append(`
				<div class="col-12">
					<div class="row" id="` + param.id + `_FE7CD4D1BF3FEA9A0D921E224B3FA24C">
						<div class="col-6">
							<ul class="pagination pagination-sm">
								<li class="page-item" style="padding-right:10px;">
									<select id="` + param.id +`_9E477E527D65BD58203B92442C29B87F" class="custom-select custom-select-sm" style="border-radius: 0px;min-width: 70px;width: 70px;">
									  ` + pageSizeOptionHtml + `
									</select>
								</li>
								<li id="` + param.id + `_B544033A510E88F9FD2E57477DD159D6" class="page-item disabled" style="cursor: pointer;">
									<a class="page-link" href="javascript:;"><i class="fas fa-step-backward"></i></a>
								</li>
								<li id="` + param.id + `_4E7B25AA1ECF24D701D2400C0A16EC71" class="page-item disabled" style="cursor: pointer;">
									<a class="page-link" href="javascript:;"><i class="fas fa-caret-left fa-lg"></i></a>
								</li>
								<li class="page-item disabled" style="cursor: pointer;">
									<div class="input-group input-group-sm">
										<input id="` + param.id + `_6D9AC9408AC2CED0CDA3E0080099CAD5" value="5" type="text" class="form-control" style="width:50px;border-radius:0em;border-left: 0px solid white;border-right: 0px solid white;` + pageConfig_ShowGoNum + `">
										<!--
										<div class="input-group-append">
											<span class="input-group-text" style="border-radius: 0px;border-left: 1px solid white;border-right: 1px solid white;">GO</span>
										</div>
										-->
									</div>
								</li>
								<li id="` + param.id + `_8DD511B6D7CCE85142B784AF90ECBF74" class="page-item disabled" style="cursor: pointer;">
									<a class="page-link" href="javascript:;"><i class="fas fa-caret-right fa-lg"></i></a>
								</li>
								<li id="` + param.id + `_5147B0AED3B7D961E930084FAB5491E1" class="page-item disabled" style="cursor: pointer;padding-right:10px;">
									<a class="page-link" href="javascript:;"><i class="fas fa-step-forward"></i></a>
								</li>
							</ul>
						</div>
						<div class="col-6 float-right">
							<ul class="pagination pagination-sm float-right">
								<li class="page-item disabled">
									<span id="` + param.id + `_749C645D0898B183B7C2B501ADDC5EBC" class="page-link" style="border:0px;">第?/?页,共?条数据</span>
								</li>
							</ul>
						</div>
					</div>
				</div>
			`);
        }

		if(pageData.currentPage > pageData.totalPageNum){
			$('#' + param.id + '_B544033A510E88F9FD2E57477DD159D6').attr("class","page-item" + (pageData.currentPage === 1 ? ' disabled' : ''));
			$('#' + param.id + '_4E7B25AA1ECF24D701D2400C0A16EC71').attr("class","page-item" + (pageData.currentPage === 1 ? ' disabled' : ''));
			$('#' + param.id + '_6D9AC9408AC2CED0CDA3E0080099CAD5').val(pageData.currentPage);
			$('#' + param.id + '_8DD511B6D7CCE85142B784AF90ECBF74').attr("class","page-item disabled");
			$('#' + param.id + '_5147B0AED3B7D961E930084FAB5491E1').attr("class","page-item disabled");
			$('#' + param.id + '_749C645D0898B183B7C2B501ADDC5EBC').html('第<span>' + pageData.currentPage + '</span>/<span>' + pageData.totalPageNum + '</span>页,共' + pageData.totalDataNum + '条数据');
		}else{
			$('#' + param.id + '_B544033A510E88F9FD2E57477DD159D6').attr("class","page-item" + (pageData.currentPage === 1 ? ' disabled' : ''));
			$('#' + param.id + '_4E7B25AA1ECF24D701D2400C0A16EC71').attr("class","page-item" + (pageData.currentPage === 1 ? ' disabled' : ''));
			$('#' + param.id + '_6D9AC9408AC2CED0CDA3E0080099CAD5').val(pageData.currentPage);
			$('#' + param.id + '_8DD511B6D7CCE85142B784AF90ECBF74').attr("class","page-item" + (pageData.currentPage === pageData.totalPageNum ? ' disabled' : ''));
			$('#' + param.id + '_5147B0AED3B7D961E930084FAB5491E1').attr("class","page-item" + (pageData.currentPage === pageData.totalPageNum ? ' disabled' : ''));
			$('#' + param.id + '_749C645D0898B183B7C2B501ADDC5EBC').html('第<span>' + pageData.currentPage + '</span>/<span>' + pageData.totalPageNum + '</span>页,共' + pageData.totalDataNum + '条数据');
		}

		var firstPageClickEvent = $._data($('#' + param.id + '_B544033A510E88F9FD2E57477DD159D6')[0],'events');
		if(firstPageClickEvent === undefined){
			$('#' + param.id + '_B544033A510E88F9FD2E57477DD159D6').on('click',function(e){
				if($(this).attr('class') === 'page-item disabled'){
					return;
				}

				var ct = $('#' + param.id +`_749C645D0898B183B7C2B501ADDC5EBC`).children(":first").text();
				var ps = $('#' + param.id +`_9E477E527D65BD58203B92442C29B87F`).val();
				var ret = param.page('first',ct,ps);
			});
		}
		var prevPageClickEvent = $._data($('#' + param.id + '_4E7B25AA1ECF24D701D2400C0A16EC71')[0],'events');
		if(prevPageClickEvent === undefined){
			$('#' + param.id + '_4E7B25AA1ECF24D701D2400C0A16EC71').on('click',function(e){
				if($(this).attr('class') === 'page-item disabled'){
					return;
				}

				var ct = $('#' + param.id +`_749C645D0898B183B7C2B501ADDC5EBC`).children(":first").text();
				var ps = $('#' + param.id +`_9E477E527D65BD58203B92442C29B87F`).val();
				var ret = param.page('prev',ct,ps);
			});
		}
		var currentPageClickEvent = $._data($('#' + param.id + '_6D9AC9408AC2CED0CDA3E0080099CAD5')[0],'events');
		if(currentPageClickEvent !== undefined){
			$('#' + param.id + '_6D9AC9408AC2CED0CDA3E0080099CAD5').unbind();
		}

		$('#' + param.id + '_6D9AC9408AC2CED0CDA3E0080099CAD5').on('keydown',function(e){
			if (e.keyCode == 13) {
				let checkRet = EdeyeAdmin.checkKit.finalCheck({
			    	'name': $('#' + param.id + '_6D9AC9408AC2CED0CDA3E0080099CAD5').val()
			    }, true, {
			        'name': {
			            method: 'integerRange',
			            methodParam: ['&&', ['>=', 1], ['<=', pageData.totalPageNum]],
			            msg: '查询页不在正常范围值'
			        }
			    });
			    if (!checkRet.flag) {
			    	checkMsg = (checkRet.msg.join('<br />'));
		            EdeyeAdmin.closeMsg(checkMsg,true,3);
		            return;
			    }

				var ct = $('#' + param.id +`_749C645D0898B183B7C2B501ADDC5EBC`).children(":first").text();
				var ps = $('#' + param.id +`_9E477E527D65BD58203B92442C29B87F`).val();
			    // var ret = param.page('goto',pageData.ct,ps);
			    var ret = param.page('goto',ct,ps);
			}
		});

		var nextPageClickEvent = $._data($('#' + param.id + '_8DD511B6D7CCE85142B784AF90ECBF74')[0],'events');
		if(nextPageClickEvent === undefined){
			$('#' + param.id + '_8DD511B6D7CCE85142B784AF90ECBF74').on('click',function(e){
				if($(this).attr('class') === 'page-item disabled'){
					return;
				}

				var ct = $('#' + param.id +`_749C645D0898B183B7C2B501ADDC5EBC`).children(":first").text();
				var ps = $('#' + param.id +`_9E477E527D65BD58203B92442C29B87F`).val();
				var ret = param.page('next',ct,ps);
			});
		}
		var lastPageClickEvent = $._data($('#' + param.id + '_5147B0AED3B7D961E930084FAB5491E1')[0],'events');
		if(lastPageClickEvent === undefined){
			$('#' + param.id + '_5147B0AED3B7D961E930084FAB5491E1').on('click',function(e){
				if($(this).attr('class') === 'page-item disabled'){
					return;
				}

				var ct = $('#' + param.id +`_749C645D0898B183B7C2B501ADDC5EBC`).children(":first").text();
				var ps = $('#' + param.id +`_9E477E527D65BD58203B92442C29B87F`).val();
				var tpn = $('#' + param.id +`_749C645D0898B183B7C2B501ADDC5EBC`).children(":eq(1)").text();
				var ret = param.page('last',ct,ps,tpn);
			});
		}

		// $('#' + param.id + '_9E477E527D65BD58203B92442C29B87F').find("option:contains('" + pageData.pageSize + "')").attr("selected",true);
		var pageSizeEvent = $._data($('#' + param.id + '_9E477E527D65BD58203B92442C29B87F')[0],'events');
		if(pageSizeEvent === undefined){
			$('#' + param.id + '_9E477E527D65BD58203B92442C29B87F').on('change',function(e){
				if($(this).attr('class') === 'page-item disabled'){
					return;
				}

				var ct = $('#' + param.id +`_749C645D0898B183B7C2B501ADDC5EBC`).children(":first").text();
				var ps = $('#' + param.id +`_9E477E527D65BD58203B92442C29B87F`).val();
				var tpn = $('#' + param.id +`_749C645D0898B183B7C2B501ADDC5EBC`).children(":eq(1)").text();
				var ret = param.page('change',ct,ps,tpn);
				// var ret = param.page('change',ct,$('#' + param.id + '_9E477E527D65BD58203B92442C29B87F').val(),tpn);
			});
		}
	}

	_Edeye.initDataTablePhone = function(param,pageData){
		initDataTableMenuPhone(param,pageData);
		this.setDataTableDataPhone(param,pageData);
	}

    // ############# admin table phone end #############

	_Edeye.reLoginInner = function(){
		if($('#_A6B546D4A84E5319592E1422782DA53C').length > 0){
			return;
		}
		var icon = 'fas fa-user';
		var url = '/system/public/relogin';
		var auth = this.getLoginInfo();
		if(auth.roleInfo.id === '0'){
			icon = 'fas fa-user-secret';
			url += 'Admin';
		}
		var loginBox =
			`<div id="_A6B546D4A84E5319592E1422782DA53C" class="col-12 m-auto" style="padding: 10px;">
				<div class="input-group mb-1" id="_A6B546D4A84E5319592E1422782DA53C_1">
					<div class="input-group-prepend">
						<span class="input-group-text"><i class="` + icon + ` style="width: 15px;""></i></span>
					</div>
					<input class="form-control" placeholder="登录名称" readonly />
				</div>
				<div class="input-group mb-2" id="_A6B546D4A84E5319592E1422782DA53C_2">
					<div class="input-group-prepend">
						<span class="input-group-text"><i class="fas fa-lock" style="width: 15px;"></i></span>
					</div>
					<input type="password" class="form-control" placeholder="登录密码" />
				</div>
				<div class="input-group mb-2" id="_A6B546D4A84E5319592E1422782DA53C_3">
					<div class="input-group-prepend">
						<span class="input-group-text"><i class="fas fa-user-shield" style="width: 15px;"></i></span>
					</div>
					<select class="custom-select" id="_A6B546D4A84E5319592E1422782DA53C_4">
						<option value="AD" selected>统一认证登录</option>
						<option value="CARD">工号</option>
					</select>
				</div>
				<button class="btn btn-sm btn-success btn-block float-right mb-2" type="button">重新登录</button>
			</div>`;
		console.log('ok');
		$('.modal').modal('hide');
        layer.open({
            type: 1,
            title: false,
            offset: '200px',
            skin: 'layui-layer-rim',
            // area: 'auto',
            area: '300px',
            content: loginBox,
            closeBtn: 2,
            time: -1,
            anim: 5,
            resize: false,
            success: function (layero, index) {
                $('#_A6B546D4A84E5319592E1422782DA53C div input:eq(0)').val(auth.loginInfo.login_name);
                $('#_A6B546D4A84E5319592E1422782DA53C div input:eq(1)').focus();

                $('#_A6B546D4A84E5319592E1422782DA53C_1').css('display','none');
                $('#_A6B546D4A84E5319592E1422782DA53C_2').css('display','none');

                $('#_A6B546D4A84E5319592E1422782DA53C_4').bind('change',function(e){
                	var cssDisplay = $('#_A6B546D4A84E5319592E1422782DA53C_1').css('display');
                	if('none' === cssDisplay){
                		cssDisplay = '';
                	}else{
                		cssDisplay = 'none';
                	}
                	$('#_A6B546D4A84E5319592E1422782DA53C_1').css('display',cssDisplay);
                	$('#_A6B546D4A84E5319592E1422782DA53C_2').css('display',cssDisplay);
                });

                $('#_A6B546D4A84E5319592E1422782DA53C button').bind('click', function (e) {
                	if($('#_A6B546D4A84E5319592E1422782DA53C_1').css('display') === 'none'){
                		// TODO 实际上线改成上线后的地址
        				var pathName = window.location.pathname.substring(1);
        				var webName = pathName == '' ? '' : pathName.substring(0, pathName.indexOf('/'));
        				if (webName == "") {
        					window.location.href = (window.location.protocol + '//' + window.location.host + '/system/public/oauth');
        				}else {
        					window.location.href = (window.location.protocol + '//' + window.location.host + '/' + webName + '/system/public/oauth');
        				}
                		return;
                	}
                    var ajaxCall = $.ajax({
                        type: 'POST',
                        url: url,
                        data: {
                            'login_name': auth.loginInfo.login_name,
                            'login_password': md5($('#_A6B546D4A84E5319592E1422782DA53C div input:eq(1)').val()).toUpperCase(),
                            'login_type': $('#_A6B546D4A84E5319592E1422782DA53C div select:eq(0)').val()
                        },
                        dataType: 'json'
                    });
                    ajaxCall.done(function (ret, status, response) {
                        layer.msg('同上', {
                            content: ret.datetime.substring(11, 20) + " : " + ret.msg,
                            anim: 5,
                            scrollbar: false,
                            time: 2000,
                            shade: 0.6
                        });
                        if (ret.code === '200') {
                            layer.close(index);
                            setTimeout(function () {
                                layer.closeAll();
                            }, 1000);
                        }
                    });
                    ajaxCall.fail(function (response, status) {
                        console.log(response);
                    });
                });
            },
            end: function () {
            }
        });
    }

    _Edeye.loginCheck = function (FUNC,ERROR) {
        var ajaxCall = $.ajax({
            type: 'POST',
            url: '/system/public/loginCheck',
            dataType: 'json'
        });
        //console.log(ajaxCall);
        ajaxCall.done(function (ret, status, response) {
            // console.log(response);
            if (ret.code == '401') {
                EdeyeAdmin.reLoginInner();
                if ('function' == typeof (ERROR)) {
                	ERROR();
                }
            }
            if (ret.code == '200' && 'function' == typeof (FUNC)) {
                FUNC();
            }
        });
        ajaxCall.fail(function (response, status) {
            var errorMsg = '';
            if (response.status === 500) {
                // 后台500错误
                // status: 500
                // statusText: "error"
                // responseJSON: {msg: "/ by zero", datetime: "2018-10-02 11:49:42", code: "500", class: "java.lang.ArithmeticException"}
                errorMsg = response.responseJSON.msg;
            } else if (response.status === 0) {
                // 服务器已停止时
                // status: 0
                // statusText: "error"
                errorMsg = '服务器连接失败,请联系管理员';
            } else if (response.status === 403) {
                // 无权限弹出提示框
                // ?status: 403
                // ?statusText: "error"
                errorMsg = '无此权限';
            } else if (response.status === 404) {
                // 404
            } else if (response.status === 500) {
                // 500
            }
            if ('function' == typeof (ERROR)) {
            	ERROR(response);
            }else{
            	console.log(response);
            }
            EdeyeAdmin.closeMsg(errorMsg, true, 3);
        });
    }

    _Edeye.logout = function () {
        var layerId = layer.confirm('是否退出系统', {
            btn: ['确认退出', '暂不退出']
        }, function () {
            layer.close(layerId);
            var ajaxCall = $.ajax({
                type: 'POST',
                url: '/system/public/logout',
                dataType: 'json'
            });
            ajaxCall.done(function (ret, status, response) {
                window.localStorage.removeItem("auth");
                var pathName = window.location.pathname.substring(1);
                var webName = pathName == '' ? '' : pathName.substring(0, pathName.indexOf('/'));
                if (webName == "") {
                    window.location.href = (window.location.protocol + '//' + window.location.host + '/login');
                } else {
                    window.location.href = (window.location.protocol + '//' + window.location.host + '/' + webName + '/login');
                }
            });
            ajaxCall.fail(function (response, status) {
                console.log(response);
            });
        }, function () {
        });

    }

    _Edeye.getLoginInfo = function () {
    	if(window.localStorage.getItem("auth") === undefined){
            var ajaxCall = $.ajax({
                type: 'POST',
                async: false,
                url: '/system/public/loginInfo',
                dataType: 'json'
            });
            ajaxCall.done(function (ret, status, response) {
                if ('function' == typeof (SUCCESS)) {
                    window.localStorage.removeItem("auth");
                    window.localStorage.setItem("auth", JSON.stringify(ret.data));
                }
            });
    	}
    	if(window.localStorage.getItem("auth") === 'undefined'){
        	setTimeout(function(){
        		window.location.reload();
        	},1000);
        	return {};
    	}
        var auth = JSON.parse(window.localStorage.getItem("auth"));
        return auth;
    }

    _Edeye.loginInfo = function (SUCCESS, ERROR) {
        var ajaxCall = $.ajax({
            type: 'POST',
            url: '/system/public/loginInfo',
            // data : data,
            dataType: 'json' // xml、json、script、html
        });
        ajaxCall.done(function (ret, status, response) {
            if ('function' == typeof (SUCCESS)) {
                window.localStorage.removeItem("auth");
                window.localStorage.setItem("auth", JSON.stringify(ret.data));
                SUCCESS(ret);
            }
        });
        ajaxCall.fail(function (response, status) {
            if ('function' == typeof (ERROR)) {
                ERROR(response);
            }
        });
    }

    _Edeye.initLeftMenu = function (TEST) {
        EdeyeAdmin.DYNAMIC_MENU_METHOD = function (url) {
            EdeyeAdmin.loginCheck(function () {
                TEST(url);
            });
        };

        var retMenuInfo = this.getLoginInfo().menuInfo;

        var filterMenuInfo = this.getLoginInfo().menuInfo.filter(function(item){
        	return item.show === '0';
        });
        filterMenuInfo.sort(function (a, b) {
            return parseInt(a.sort) - parseInt(b.sort)
        });

        /*
        filterMenuInfo = [
        	{id:'11',pid:'1',name:'11',url:'systemDemoCheckbox',icon:'fab fa-affiliatetheme'},
        	{id:'12',pid:'1',name:'12',url:'',icon:'far fa-address-book'},
        	{id:'13',pid:'1',name:'13',url:'',icon:'fas fa-cannabis'},
        	{id:'111',pid:'11',name:'111',url:'',icon:'fab fa-affiliatetheme'},
        	{id:'112',pid:'11',name:'112',url:'',icon:'far fa-address-book'},
        	{id:'113',pid:'11',name:'113',url:'',icon:'fas fa-cannabis'},
        	{id:'1111',pid:'111',name:'1111',url:'',icon:'fab fa-affiliatetheme'},
        	{id:'1112',pid:'111',name:'1112',url:'',icon:'far fa-address-book'},
        	{id:'1113',pid:'111',name:'1113',url:'',icon:'fas fa-cannabis'},
        	{id:'11111',pid:'1111',name:'11111',url:'',icon:'fab fa-affiliatetheme'},
        	{id:'11112',pid:'1111',name:'11112',url:'',icon:'far fa-address-book'},
        	{id:'11113',pid:'1111',name:'11113',url:'',icon:'fas fa-cannabis'}
        ];
        */

        // 第1次遍历:如果1条数据的父数据不存在,则此条数据即为第1层数据
        var lv1s = [];
        for (var tmpKey in filterMenuInfo) {
        	var tmpData = filterMenuInfo[tmpKey];
        	if(filterMenuInfo[tmpKey].url === undefined){
        		filterMenuInfo[tmpKey].url = '';
        	}
        	var isLv1 = true;
            for (var tmpInnerKey in filterMenuInfo) {
            	var tmpInnerData = filterMenuInfo[tmpInnerKey];
            	if(tmpData.pid === tmpInnerData.id){
            		isLv1 = false;
            		break;
            	}
            }
            if(isLv1){
            	lv1s.push(tmpData);
            }
        }

        // 第2次遍历:如果1条数据的父数据在lv1s中,则此条数据即为第2层数据
        var lv2s = [];
        for (var tmpKey in lv1s) {
        	var tmpData = lv1s[tmpKey];
        	for (var tmpInnerKey in filterMenuInfo) {
            	var tmpInnerData = filterMenuInfo[tmpInnerKey];
            	if(tmpData.id === tmpInnerData.pid){
            		lv2s.push(tmpInnerData);
            	}
        	}
        }

        // 第3次遍历:如果1条数据的父数据在lv2s中,则此条数据即为第3层数据,将第3层数据添加到第2层中
        for (var tmpKey in lv2s) {
        	var tmpData = lv2s[tmpKey];
        	for (var tmpInnerKey in filterMenuInfo) {
            	var tmpInnerData = filterMenuInfo[tmpInnerKey];
            	if(tmpData.id === tmpInnerData.pid){
            		if(tmpData.sub === undefined){
            			tmpData.sub = [];
            		}
            		tmpData.sub.push(tmpInnerData);
            	}
        	}
        }

        // 第4次遍历:将第2层数据数据添加到第1层中
        for (var tmpKey in lv1s) {
        	var tmpData = lv1s[tmpKey];
        	for (var tmpInnerKey in lv2s) {
            	var tmpInnerData = lv2s[tmpInnerKey];
            	if(tmpData.id === tmpInnerData.pid){
            		if(tmpData.sub === undefined){
            			tmpData.sub = [];
            		}
            		tmpData.sub.push(tmpInnerData);
            	}
        	}
        }

        var html = '';

        for (var tmpKey in lv1s) {
            var lv1 = lv1s[tmpKey];
            if (lv1.sub !== undefined && lv1.sub.length > 0) {
                var lv2s = lv1.sub;
                html += `
					<li class="treeview">
						<a href="javascript:void(0);" class="edeye-leftmenu-lv1" onclick="EdeyeAdmin.DYNAMIC_MENU_METHOD('` + lv1.url + `');" title="` + lv1.name + `" data-toggle="tooltip" data-placement="right">
							<i class="` + lv1.icon + `"></i>
							<span>` + lv1.name + `</span>
							<span class="pull-right-container">
								<i class="fa fa-angle-left pull-right"></i>
							</span>
						</a>
						<ul class="treeview-menu" style="display: none;">
				`;
                for (var tmpInnerKey in lv2s) {
                    var lv2 = lv2s[tmpInnerKey];
                    if (lv2.sub !== undefined && lv2.sub.length > 0) {
                        var lv3s = lv2.sub;
                        // console.log(lv3s);
                        html += `
							<li class="treeview">
								<a onclick="EdeyeAdmin.DYNAMIC_MENU_METHOD('` + lv2.url + `');" href="javascript:void(0);" class="edeye-leftmenu-lv1" title="` + lv2.name + `" data-toggle="tooltip" data-placement="right">
									<i class="` + lv2.icon + `"></i>
									<span>` + lv2.name + `</span>
									<span class="pull-right-container">
										<i class="fa fa-angle-left pull-right"></i>
									</span>
								</a>
								<ul class="treeview-menu" style="display: none;">
						`;
                        for (var tmpInnerInnerKey in lv3s) {
                            html += `
								<li>
									<a onclick="EdeyeAdmin.DYNAMIC_MENU_METHOD('` + lv3s[tmpInnerInnerKey].url + `');" href="javascript:void(0);" title="` + lv3s[tmpInnerInnerKey].name + `" data-toggle="tooltip" data-placement="right"">
										<i class="` + lv3s[tmpInnerInnerKey].icon + `"></i>
										<span>` + lv3s[tmpInnerInnerKey].name + `</span>
									</a>
							    </li>
							`;
                        }
                        html += `</ul></li>`;
                    } else {
                        html += `
							<li>
								<a href="javascript:void(0);" onclick="EdeyeAdmin.DYNAMIC_MENU_METHOD('` + lv2.url + `');" title="` + lv2.name + `" data-toggle="tooltip" data-placement="right"">
									<i class="` + lv2.icon + `"></i>
									<span>` + lv2.name + `</span>
								</a>
						    </li>
						`;
                    }
                }
                html += `</ul></li>`;
            } else {
                html += `
					<li>
						<a href="javascript:void(0);" onclick="EdeyeAdmin.DYNAMIC_MENU_METHOD('` + lv1.url + `');" title="` + lv1.name + `" data-toggle="tooltip" data-placement="right"">
							<i class="` + lv1.icon + `"></i>
							<span>` + lv1.name + `</span>
						</a>
				    </li>
				`;
            }
        }
        $('#_12b3e0f1d0745b61027bffa749ec3794').append(html);

        setTimeout(function () {
            EdeyeAdmin.toggleMenu('self');
            //EdeyeAdmin.toggleMenu('all');

            $(".sidebar-fold").on("click", function () {
                EdeyeAdmin.toggleMenuType();
            });

            $(window).resize(function () {
                EdeyeAdmin.fix();
            });
        }, 100);

        EdeyeAdmin.fix();

    }

    _Edeye.fix = function () {
        $('.sidebar').slimScroll({
            height: ($(window).height() - 80) + 'px'
        });
        $('.content-wrapper').css('min-height',
            $(window).height() - ($('.main-footer').outerHeight() || 0));
    }

    _Edeye.toggleMenuType = function () {
        $('.logo-mini').toggle(200);
        var isClose = $('body').hasClass('sidebar-collapse');
        if (isClose) {
            $('body').removeClass('sidebar-collapse');

            $('.main-sidebar').animate({
                width: '230px'
            });

            $('.content-wrapper,.main-footer').animate({
                'margin-left': '230px'
            });

            $('.sidebar-menu li a span').css('display', '');

            $('.treeview-menu,.treeview-menu > li').css('padding-left', '5px');

            $('[data-toggle="tooltip"]').tooltip('disable');
        } else {
            $('body').addClass('sidebar-collapse');

            $('.main-sidebar').animate({
                width: '50px'
            });

            $('.main-sidebar').animate({
                '-webkit-transform': 'rotate(0deg)'
            });

            $('.content-wrapper,.main-footer').animate({
                'margin-left': '50px'
            });

            $('.treeview-menu,.treeview-menu > li').css('padding-left', '0px');

            $('.sidebar-menu li a span').css('display', 'none');

            $('[data-toggle="tooltip"]').tooltip('enable');
        }

    }

    _Edeye.toggleMenu = function (type) {
        if ('self' === type) {
            $(".edeye-leftmenu-lv1,.edeye-leftmenu-lv2").on("click", function () {
                var display = $(this).next().css('display');
                var selfI = $(this).find('.pull-right-container').find('i');
                if ('block' === display) {
                    // 上拉选项
                    $(this).next().slideUp({
                        duration: 100
                    });

                    // 修改右侧图标方向
                    selfI.removeClass('edeye-rotate-90');
                    selfI.addClass('edeye-rotate-0');
                } else if ('none' === display) {
                    // 下拉选项
                    $(this).next().slideDown({
                        duration: 100
                    });

                    // 修改右侧图标方向
                    selfI.removeClass('edeye-rotate0');
                    selfI.addClass('edeye-rotate-90');
                }
            });
        } else if ('all' === type) {
            $(".edeye-leftmenu-lv1").on("click", function () {
                var clickThis = $(this);
                var display = $(this).next().css('display');

                var eachCount = 0;
                $(".edeye-leftmenu-lv1").each(function () {
                    eachCount++

                    var selfI = $(this).find('.pull-right-container').find('i');

                    // 上拉选项
                    $(this).next().slideUp({
                        duration: 100
                    });

                    // 修改右侧图标方向
                    selfI.removeClass('edeye-rotate-90');
                    selfI.addClass('edeye-rotate-0');

                    if (eachCount >= $(".edeye-leftmenu-lv1").length) {
                        var clickSelfI = clickThis.find('.pull-right-container').find('i');
                        if ('block' === display) {
                            // 上拉选项
                            clickThis.next().slideUp({
                                duration: 100
                            });

                            // 修改右侧图标方向
                            clickSelfI.removeClass('edeye-rotate-90');
                            clickSelfI.addClass('edeye-rotate-0');
                        } else if ('none' === display) {
                            // 下拉选项
                            clickThis.next().slideDown({
                                duration: 100
                            });

                            // 修改右侧图标方向
                            clickSelfI.removeClass('edeye-rotate0');
                            clickSelfI.addClass('edeye-rotate-90');
                        }
                    }
                });
            });
            $(".edeye-leftmenu-lv2").on("click", function () {
                var clickThis = $(this);
                var display = $(this).next().css('display');

                var eachCount = 0;
                $(".edeye-leftmenu-lv2").each(function () {
                    eachCount++

                    var selfI = $(this).find('.pull-right-container').find('i');

                    // 上拉选项
                    $(this).next().slideUp({
                        duration: 100
                    });

                    // 修改右侧图标方向
                    selfI.removeClass('edeye-rotate-90');
                    selfI.addClass('edeye-rotate-0');

                    if (eachCount >= $(".edeye-leftmenu-lv2").length) {
                        var clickSelfI = clickThis.find('.pull-right-container').find('i');
                        if ('block' === display) {
                            // 上拉选项
                            clickThis.next().slideUp({
                                duration: 100
                            });

                            // 修改右侧图标方向
                            clickSelfI.removeClass('edeye-rotate-90');
                            clickSelfI.addClass('edeye-rotate-0');
                        } else if ('none' === display) {
                            // 下拉选项
                            clickThis.next().slideDown({
                                duration: 100
                            });

                            // 修改右侧图标方向
                            clickSelfI.removeClass('edeye-rotate0');
                            clickSelfI.addClass('edeye-rotate-90');
                        }
                    }
                });
            });
        }
    }

    window.EdeyeAdmin = _Edeye;
})(window);